Jump to error not lint (#3271)

* dont jump to lints

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2024-08-04 19:44:33 -07:00
committed by GitHub
parent a0167f6ba6
commit f4848d7dea
5 changed files with 110 additions and 9 deletions

View File

@ -22,7 +22,7 @@ import {
historyKeymap,
history,
} from '@codemirror/commands'
import { lintGutter, lintKeymap } from '@codemirror/lint'
import { diagnosticCount, lintGutter, lintKeymap } from '@codemirror/lint'
import {
foldGutter,
foldKeymap,
@ -196,7 +196,10 @@ export const KclEditorPane = () => {
// On first load of this component, ensure we show the current errors
// in the editor.
kclManager.setDiagnosticsForCurrentErrors()
// Make sure we don't add them twice.
if (diagnosticCount(_editorView.state) === 0) {
kclManager.setDiagnosticsForCurrentErrors()
}
}}
/>
</div>