Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix vim quit #1934

Merged
merged 3 commits into from
Feb 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion apps/studio/src/components/TabQueryEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@
class="actions btn-group"
ref="actions"
>
<x-button v-if="showDryRun" class="btn btn-flat btn-small" :disabled="$config.isCommunity" @click="dryRun = !dryRun">

Check warning on line 72 in apps/studio/src/components/TabQueryEditor.vue

View workflow job for this annotation

GitHub Actions / build (macos-11)

'class' should be on a new line

Check warning on line 72 in apps/studio/src/components/TabQueryEditor.vue

View workflow job for this annotation

GitHub Actions / build (macos-11)

':disabled' should be on a new line

Check warning on line 72 in apps/studio/src/components/TabQueryEditor.vue

View workflow job for this annotation

GitHub Actions / build (macos-11)

'@click' should be on a new line

Check warning on line 72 in apps/studio/src/components/TabQueryEditor.vue

View workflow job for this annotation

GitHub Actions / build (ubuntu-20.04)

'class' should be on a new line

Check warning on line 72 in apps/studio/src/components/TabQueryEditor.vue

View workflow job for this annotation

GitHub Actions / build (ubuntu-20.04)

':disabled' should be on a new line

Check warning on line 72 in apps/studio/src/components/TabQueryEditor.vue

View workflow job for this annotation

GitHub Actions / build (ubuntu-20.04)

'@click' should be on a new line

Check warning on line 72 in apps/studio/src/components/TabQueryEditor.vue

View workflow job for this annotation

GitHub Actions / build (windows-latest)

'class' should be on a new line

Check warning on line 72 in apps/studio/src/components/TabQueryEditor.vue

View workflow job for this annotation

GitHub Actions / build (windows-latest)

':disabled' should be on a new line

Check warning on line 72 in apps/studio/src/components/TabQueryEditor.vue

View workflow job for this annotation

GitHub Actions / build (windows-latest)

'@click' should be on a new line
<x-label>Dry Run</x-label>
<i v-if="$config.isCommunity" class="material-icons menu-icon">stars</i>

Check warning on line 74 in apps/studio/src/components/TabQueryEditor.vue

View workflow job for this annotation

GitHub Actions / build (macos-11)

'class' should be on a new line

Check warning on line 74 in apps/studio/src/components/TabQueryEditor.vue

View workflow job for this annotation

GitHub Actions / build (ubuntu-20.04)

'class' should be on a new line

Check warning on line 74 in apps/studio/src/components/TabQueryEditor.vue

View workflow job for this annotation

GitHub Actions / build (windows-latest)

'class' should be on a new line
<input v-else type="checkbox" v-model="dryRun">
</x-button>
<x-button
Expand Down Expand Up @@ -803,7 +803,13 @@
if (this.userKeymap === "vim") {
const codeMirrorVimInstance = document.querySelector(".CodeMirror").CodeMirror.constructor.Vim
codeMirrorVimInstance.defineEx("write", "w", this.triggerSave)
codeMirrorVimInstance.defineEx("quit", "q", this.close)
codeMirrorVimInstance.defineEx("quit", "q", () => {
if (this.tab.unsavedChanges) {
this.$modal.show(`sure-${this.tab.id}`)
} else {
this.close();
}
})
codeMirrorVimInstance.defineEx("qa", "qa", () => {this.$root.$emit(AppEvent.closeAllTabs)})
codeMirrorVimInstance.defineEx("x", "x", this.writeQuit)
codeMirrorVimInstance.defineEx("wq", "wq", this.writeQuit)
Expand Down