Skip to content

Commit

Permalink
feat: auto clear selector
Browse files Browse the repository at this point in the history
  • Loading branch information
HerringtonDarkholme committed Sep 15, 2024
1 parent b9b9519 commit 341a912
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions website/src/components/PatternEditor.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<script setup lang="ts">
import { Monaco, EditorWithPanel } from './editors'
import { shallowRef, watchEffect, provide, inject } from 'vue'
import { shallowRef, watchEffect, provide, inject, watch } from 'vue'
import PatternNode from './dump/PatternNode.vue'
import { highlightKey, PatternTree, Pos } from './dump/dumpTree'
import { langLoadedKey, usePattern } from './astGrep'
import { dumpPattern } from 'ast-grep-wasm'
import PatternConfig from './PatternConfig.vue'
import Error from './utils/Error.vue'
defineProps({
const props = defineProps({
language: {
type: String,
default: 'javascript'
Expand Down Expand Up @@ -40,6 +40,10 @@ watchEffect(() => {
}
})
watch(() => [query.value, props.language], () => {
selector.value = ''
})
let cursorPosition = shallowRef<Pos>()
provide(highlightKey, e => {
highlights.value = [e]
Expand Down

0 comments on commit 341a912

Please sign in to comment.