mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-11-23 20:54:50 +03:00
refactor: Display selected code editor over generic Editor
This commit is contained in:
parent
08bd7f7129
commit
f96f1ae2c3
@ -23,7 +23,7 @@
|
||||
const unsubscribeopenInEditor = listen<string>(
|
||||
'menu://project/open-in-vscode/clicked',
|
||||
async () => {
|
||||
const path = `${$userSettings.defaultCodeEditor}://file${project.vscodePath}?windowId=_blank`;
|
||||
const path = `${$userSettings.defaultCodeEditor.schemeIdentifer}://file${project.vscodePath}?windowId=_blank`;
|
||||
openExternalUrl(path);
|
||||
}
|
||||
);
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
async function openInEditor() {
|
||||
openExternalUrl(
|
||||
`${$userSettings.defaultCodeEditor}://file${project.vscodePath}/?windowId=_blank`
|
||||
`${$userSettings.defaultCodeEditor.schemeIdentifer}://file${project.vscodePath}/?windowId=_blank`
|
||||
);
|
||||
}
|
||||
</script>
|
||||
@ -70,7 +70,7 @@
|
||||
<div class="empty-board__suggestions__link__icon">
|
||||
<Icon name="vscode" />
|
||||
</div>
|
||||
<span class="text-12">Open in Editor</span>
|
||||
<span class="text-12">`Open in {$userSettings.defaultCodeEditor.displayName}`</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -166,7 +166,7 @@
|
||||
async function openAllConflictedFiles() {
|
||||
for (const file of conflictedFiles) {
|
||||
const absPath = await join(project.vscodePath, file.path);
|
||||
openExternalUrl(`${$userSettings.defaultCodeEditor}://file${absPath}`);
|
||||
openExternalUrl(`${$userSettings.defaultCodeEditor.schemeIdentifer}://file${absPath}`);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -177,8 +177,8 @@
|
||||
{editModeMetadata.commitOid.slice(0, 7)}
|
||||
</span>
|
||||
<InfoButton title="Edit Mode">
|
||||
Edit Mode lets you modify an existing commit in isolation or resolve conflicts. Any
|
||||
changes made, including new files, will be added to the selected commit.
|
||||
Edit Mode lets you modify an existing commit in isolation or resolve conflicts. Any changes
|
||||
made, including new files, will be added to the selected commit.
|
||||
</InfoButton>
|
||||
</h2>
|
||||
|
||||
|
@ -87,14 +87,16 @@
|
||||
/>
|
||||
{/if}
|
||||
<ContextMenuItem
|
||||
label="Open in Editor"
|
||||
label="Open in {$userSettings.defaultCodeEditor.displayName}"
|
||||
disabled={isDeleted(item)}
|
||||
on:click={async () => {
|
||||
try {
|
||||
if (!project) return;
|
||||
for (let file of item.files) {
|
||||
const absPath = await join(project.vscodePath, file.path);
|
||||
openExternalUrl(`${$userSettings.defaultCodeEditor}://file${absPath}`);
|
||||
openExternalUrl(
|
||||
`${$userSettings.defaultCodeEditor.schemeIdentifer}://file${absPath}`
|
||||
);
|
||||
}
|
||||
contextMenu.close();
|
||||
} catch {
|
||||
|
@ -46,11 +46,11 @@
|
||||
{/if}
|
||||
{#if item.lineNumber}
|
||||
<ContextMenuItem
|
||||
label="Open in Editor"
|
||||
label="Open in {$userSettings.defaultCodeEditor.displayName}"
|
||||
on:click={() => {
|
||||
projectPath &&
|
||||
openExternalUrl(
|
||||
`${$userSettings.defaultCodeEditor}://file${projectPath}/${filePath}:${item.lineNumber}`
|
||||
`${$userSettings.defaultCodeEditor.schemeIdentifer}://file${projectPath}/${filePath}:${item.lineNumber}`
|
||||
);
|
||||
contextMenu.close();
|
||||
}}
|
||||
|
Loading…
Reference in New Issue
Block a user