app,io/key: go fmt

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2026-03-17 17:10:03 +01:00
parent 65d86895b8
commit dfe4ff0200
2 changed files with 4 additions and 3 deletions
+3 -3
View File
@@ -427,11 +427,11 @@ func (w *window) addEventListeners() {
// Safari sends "insertReplacementText" for autocorrect, but the cursor is at the end of the word, so we need to find the word start.
insertLen := utf8.RuneCountInString(data)
wordStart := absStart
if absStart > snippetStart {
relPos := absStart - snippetStart
snippetRunes := []rune(st.Snippet.Text)
for i := relPos - 1; i >= 0; i-- {
if i >= len(snippetRunes) {
continue
@@ -443,7 +443,7 @@ func (w *window) addEventListeners() {
wordStart = snippetStart + i
}
}
replaceRange := key.Range{Start: wordStart, End: absStart}
w.w.EditorReplace(replaceRange, data)
+1
View File
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: Unlicense OR MIT
//go:build !darwin && !js
package key
// ModShortcut is the platform's shortcut modifier, usually the ctrl