fix: fix cursor going out of bounds when filtering response (#2850)

This commit is contained in:
Akash K
2022-11-10 03:53:28 +05:30
committed by GitHub
parent 0230942a3d
commit 356fe4591f

View File

@@ -195,9 +195,7 @@ export function useCodemirror(
ViewPlugin.fromClass(
class {
update(update: ViewUpdate) {
if (update.selectionSet) {
const cursorPos = update.state.selection.main.head
const line = update.state.doc.lineAt(cursorPos)
cachedCursor.value = {
@@ -209,7 +207,7 @@ export function useCodemirror(
line: cachedCursor.value.line,
ch: cachedCursor.value.ch,
}
}
if (update.docChanged) {
// Expensive on big files ?
cachedValue.value = update.state.doc