From a9b098cdf0aaf4c8df8b8e6bb407190d09d4d9c5 Mon Sep 17 00:00:00 2001 From: Massimo Mund Date: Wed, 24 Jul 2024 12:52:41 +0200 Subject: [PATCH] Implemented new actions `SelectWord`, `FindSelected`, `SelectNextTextOccurrence`, `SelectPreviousTextOccurrence` --- internal/action/actions.go | 74 ++++++++ internal/action/bufpane.go | 367 ++++++++++++++++++------------------ internal/buffer/cursor.go | 59 +++--- runtime/help/keybindings.md | 4 + 4 files changed, 302 insertions(+), 202 deletions(-) diff --git a/internal/action/actions.go b/internal/action/actions.go index c0f4aead8..ca42f478e 100644 --- a/internal/action/actions.go +++ b/internal/action/actions.go @@ -607,6 +607,65 @@ func (h *BufPane) CursorEnd() bool { return true } +// SelectWord selects the current word under the cursor if there is no selection already +func (h *BufPane) SelectWord() bool { + if h.Cursor.HasSelection() { + return false + } + h.Cursor.SelectWord() + return h.Cursor.HasSelection() +} + +// SelectNextTextOccurrence selects the next occurrence of the currently selected text +func (h *BufPane) SelectNextTextOccurrence() bool { + if !h.Cursor.HasSelection() { + return false + } + if h.Buf.NumCursors() > 1 { + return false + } + selectedText := string(h.Cursor.GetSelection()) + searchLoc := h.Cursor.Loc + match, found, err := h.Buf.FindNext(selectedText, h.Buf.Start(), h.Buf.End(), searchLoc, true, false) + if err != nil { + return false + } + if found { + h.Cursor.SetSelectionStart(match[0]) + h.Cursor.SetSelectionEnd(match[1]) + h.Cursor.OrigSelection[0] = h.Cursor.CurSelection[0] + h.Cursor.OrigSelection[1] = h.Cursor.CurSelection[1] + h.GotoLoc(h.Cursor.CurSelection[1]) + return true + } + return false +} + +// SelectPreviousTextOccurrence selects the previous occurrence of the currently selected text +func (h *BufPane) SelectPreviousTextOccurrence() bool { + if !h.Cursor.HasSelection() { + return false + } + if h.Buf.NumCursors() > 1 { + return false + } + selectedText := string(h.Cursor.GetSelection()) + searchLoc := h.Cursor.CurSelection[0] + match, found, err := h.Buf.FindNext(selectedText, h.Buf.Start(), h.Buf.End(), searchLoc, false, false) + if err != nil { + return false + } + if found { + h.Cursor.SetSelectionStart(match[0]) + h.Cursor.SetSelectionEnd(match[1]) + h.Cursor.OrigSelection[0] = h.Cursor.CurSelection[0] + h.Cursor.OrigSelection[1] = h.Cursor.CurSelection[1] + h.GotoLoc(h.Cursor.CurSelection[1]) + return true + } + return false +} + // SelectToStart selects the text from the cursor to the start of the buffer func (h *BufPane) SelectToStart() bool { if !h.Cursor.HasSelection() { @@ -1138,6 +1197,21 @@ func (h *BufPane) ResetSearch() bool { return false } +// FindSelected sets the currently selected text as the search term +func (h *BufPane) FindSelected() bool { + if !h.Cursor.HasSelection() { + return false + } + selectedText := string(h.Cursor.GetSelection()) + if selectedText == h.Buf.LastSearch { + return false + } + h.Buf.HighlightSearch = h.Buf.Settings["hlsearch"].(bool) + h.Buf.LastSearchRegex = false + h.Buf.LastSearch = selectedText + return true +} + // FindNext searches forwards for the last used search term func (h *BufPane) FindNext() bool { if h.Buf.LastSearch == "" { diff --git a/internal/action/bufpane.go b/internal/action/bufpane.go index 40fb7cf19..71ea56e80 100644 --- a/internal/action/bufpane.go +++ b/internal/action/bufpane.go @@ -725,127 +725,131 @@ func (h *BufPane) SetActive(b bool) { // BufKeyActions contains the list of all possible key actions the bufhandler could execute var BufKeyActions = map[string]BufKeyAction{ - "CursorUp": (*BufPane).CursorUp, - "CursorDown": (*BufPane).CursorDown, - "CursorPageUp": (*BufPane).CursorPageUp, - "CursorPageDown": (*BufPane).CursorPageDown, - "CursorLeft": (*BufPane).CursorLeft, - "CursorRight": (*BufPane).CursorRight, - "CursorStart": (*BufPane).CursorStart, - "CursorEnd": (*BufPane).CursorEnd, - "SelectToStart": (*BufPane).SelectToStart, - "SelectToEnd": (*BufPane).SelectToEnd, - "SelectUp": (*BufPane).SelectUp, - "SelectDown": (*BufPane).SelectDown, - "SelectLeft": (*BufPane).SelectLeft, - "SelectRight": (*BufPane).SelectRight, - "WordRight": (*BufPane).WordRight, - "WordLeft": (*BufPane).WordLeft, - "SubWordRight": (*BufPane).SubWordRight, - "SubWordLeft": (*BufPane).SubWordLeft, - "SelectWordRight": (*BufPane).SelectWordRight, - "SelectWordLeft": (*BufPane).SelectWordLeft, - "SelectSubWordRight": (*BufPane).SelectSubWordRight, - "SelectSubWordLeft": (*BufPane).SelectSubWordLeft, - "DeleteWordRight": (*BufPane).DeleteWordRight, - "DeleteWordLeft": (*BufPane).DeleteWordLeft, - "DeleteSubWordRight": (*BufPane).DeleteSubWordRight, - "DeleteSubWordLeft": (*BufPane).DeleteSubWordLeft, - "SelectLine": (*BufPane).SelectLine, - "SelectToStartOfLine": (*BufPane).SelectToStartOfLine, - "SelectToStartOfText": (*BufPane).SelectToStartOfText, - "SelectToStartOfTextToggle": (*BufPane).SelectToStartOfTextToggle, - "SelectToEndOfLine": (*BufPane).SelectToEndOfLine, - "ParagraphPrevious": (*BufPane).ParagraphPrevious, - "ParagraphNext": (*BufPane).ParagraphNext, - "SelectToParagraphPrevious": (*BufPane).SelectToParagraphPrevious, - "SelectToParagraphNext": (*BufPane).SelectToParagraphNext, - "InsertNewline": (*BufPane).InsertNewline, - "Backspace": (*BufPane).Backspace, - "Delete": (*BufPane).Delete, - "InsertTab": (*BufPane).InsertTab, - "Save": (*BufPane).Save, - "SaveAll": (*BufPane).SaveAll, - "SaveAs": (*BufPane).SaveAs, - "Find": (*BufPane).Find, - "FindLiteral": (*BufPane).FindLiteral, - "FindNext": (*BufPane).FindNext, - "FindPrevious": (*BufPane).FindPrevious, - "DiffNext": (*BufPane).DiffNext, - "DiffPrevious": (*BufPane).DiffPrevious, - "Center": (*BufPane).Center, - "Undo": (*BufPane).Undo, - "Redo": (*BufPane).Redo, - "Copy": (*BufPane).Copy, - "CopyLine": (*BufPane).CopyLine, - "Cut": (*BufPane).Cut, - "CutLine": (*BufPane).CutLine, - "DuplicateLine": (*BufPane).DuplicateLine, - "DeleteLine": (*BufPane).DeleteLine, - "MoveLinesUp": (*BufPane).MoveLinesUp, - "MoveLinesDown": (*BufPane).MoveLinesDown, - "IndentSelection": (*BufPane).IndentSelection, - "OutdentSelection": (*BufPane).OutdentSelection, - "Autocomplete": (*BufPane).Autocomplete, - "CycleAutocompleteBack": (*BufPane).CycleAutocompleteBack, - "OutdentLine": (*BufPane).OutdentLine, - "IndentLine": (*BufPane).IndentLine, - "Paste": (*BufPane).Paste, - "PastePrimary": (*BufPane).PastePrimary, - "SelectAll": (*BufPane).SelectAll, - "OpenFile": (*BufPane).OpenFile, - "Start": (*BufPane).Start, - "End": (*BufPane).End, - "PageUp": (*BufPane).PageUp, - "PageDown": (*BufPane).PageDown, - "SelectPageUp": (*BufPane).SelectPageUp, - "SelectPageDown": (*BufPane).SelectPageDown, - "HalfPageUp": (*BufPane).HalfPageUp, - "HalfPageDown": (*BufPane).HalfPageDown, - "StartOfText": (*BufPane).StartOfText, - "StartOfTextToggle": (*BufPane).StartOfTextToggle, - "StartOfLine": (*BufPane).StartOfLine, - "EndOfLine": (*BufPane).EndOfLine, - "ToggleHelp": (*BufPane).ToggleHelp, - "ToggleKeyMenu": (*BufPane).ToggleKeyMenu, - "ToggleDiffGutter": (*BufPane).ToggleDiffGutter, - "ToggleRuler": (*BufPane).ToggleRuler, - "ToggleHighlightSearch": (*BufPane).ToggleHighlightSearch, - "UnhighlightSearch": (*BufPane).UnhighlightSearch, - "ResetSearch": (*BufPane).ResetSearch, - "ClearStatus": (*BufPane).ClearStatus, - "ShellMode": (*BufPane).ShellMode, - "CommandMode": (*BufPane).CommandMode, - "ToggleOverwriteMode": (*BufPane).ToggleOverwriteMode, - "Escape": (*BufPane).Escape, - "Quit": (*BufPane).Quit, - "QuitAll": (*BufPane).QuitAll, - "ForceQuit": (*BufPane).ForceQuit, - "AddTab": (*BufPane).AddTab, - "PreviousTab": (*BufPane).PreviousTab, - "NextTab": (*BufPane).NextTab, - "NextSplit": (*BufPane).NextSplit, - "PreviousSplit": (*BufPane).PreviousSplit, - "Unsplit": (*BufPane).Unsplit, - "VSplit": (*BufPane).VSplitAction, - "HSplit": (*BufPane).HSplitAction, - "ToggleMacro": (*BufPane).ToggleMacro, - "PlayMacro": (*BufPane).PlayMacro, - "Suspend": (*BufPane).Suspend, - "ScrollUp": (*BufPane).ScrollUpAction, - "ScrollDown": (*BufPane).ScrollDownAction, - "SpawnMultiCursor": (*BufPane).SpawnMultiCursor, - "SpawnMultiCursorUp": (*BufPane).SpawnMultiCursorUp, - "SpawnMultiCursorDown": (*BufPane).SpawnMultiCursorDown, - "SpawnMultiCursorSelect": (*BufPane).SpawnMultiCursorSelect, - "RemoveMultiCursor": (*BufPane).RemoveMultiCursor, - "RemoveAllMultiCursors": (*BufPane).RemoveAllMultiCursors, - "SkipMultiCursor": (*BufPane).SkipMultiCursor, - "JumpToMatchingBrace": (*BufPane).JumpToMatchingBrace, - "JumpLine": (*BufPane).JumpLine, - "Deselect": (*BufPane).Deselect, - "ClearInfo": (*BufPane).ClearInfo, - "None": (*BufPane).None, + "CursorUp": (*BufPane).CursorUp, + "CursorDown": (*BufPane).CursorDown, + "CursorPageUp": (*BufPane).CursorPageUp, + "CursorPageDown": (*BufPane).CursorPageDown, + "CursorLeft": (*BufPane).CursorLeft, + "CursorRight": (*BufPane).CursorRight, + "CursorStart": (*BufPane).CursorStart, + "CursorEnd": (*BufPane).CursorEnd, + "SelectWord": (*BufPane).SelectWord, + "SelectNextTextOccurrence": (*BufPane).SelectNextTextOccurrence, + "SelectPreviousTextOccurrence": (*BufPane).SelectPreviousTextOccurrence, + "SelectToStart": (*BufPane).SelectToStart, + "SelectToEnd": (*BufPane).SelectToEnd, + "SelectUp": (*BufPane).SelectUp, + "SelectDown": (*BufPane).SelectDown, + "SelectLeft": (*BufPane).SelectLeft, + "SelectRight": (*BufPane).SelectRight, + "WordRight": (*BufPane).WordRight, + "WordLeft": (*BufPane).WordLeft, + "SubWordRight": (*BufPane).SubWordRight, + "SubWordLeft": (*BufPane).SubWordLeft, + "SelectWordRight": (*BufPane).SelectWordRight, + "SelectWordLeft": (*BufPane).SelectWordLeft, + "SelectSubWordRight": (*BufPane).SelectSubWordRight, + "SelectSubWordLeft": (*BufPane).SelectSubWordLeft, + "DeleteWordRight": (*BufPane).DeleteWordRight, + "DeleteWordLeft": (*BufPane).DeleteWordLeft, + "DeleteSubWordRight": (*BufPane).DeleteSubWordRight, + "DeleteSubWordLeft": (*BufPane).DeleteSubWordLeft, + "SelectLine": (*BufPane).SelectLine, + "SelectToStartOfLine": (*BufPane).SelectToStartOfLine, + "SelectToStartOfText": (*BufPane).SelectToStartOfText, + "SelectToStartOfTextToggle": (*BufPane).SelectToStartOfTextToggle, + "SelectToEndOfLine": (*BufPane).SelectToEndOfLine, + "ParagraphPrevious": (*BufPane).ParagraphPrevious, + "ParagraphNext": (*BufPane).ParagraphNext, + "SelectToParagraphPrevious": (*BufPane).SelectToParagraphPrevious, + "SelectToParagraphNext": (*BufPane).SelectToParagraphNext, + "InsertNewline": (*BufPane).InsertNewline, + "Backspace": (*BufPane).Backspace, + "Delete": (*BufPane).Delete, + "InsertTab": (*BufPane).InsertTab, + "Save": (*BufPane).Save, + "SaveAll": (*BufPane).SaveAll, + "SaveAs": (*BufPane).SaveAs, + "Find": (*BufPane).Find, + "FindLiteral": (*BufPane).FindLiteral, + "FindSelected": (*BufPane).FindSelected, + "FindNext": (*BufPane).FindNext, + "FindPrevious": (*BufPane).FindPrevious, + "DiffNext": (*BufPane).DiffNext, + "DiffPrevious": (*BufPane).DiffPrevious, + "Center": (*BufPane).Center, + "Undo": (*BufPane).Undo, + "Redo": (*BufPane).Redo, + "Copy": (*BufPane).Copy, + "CopyLine": (*BufPane).CopyLine, + "Cut": (*BufPane).Cut, + "CutLine": (*BufPane).CutLine, + "DuplicateLine": (*BufPane).DuplicateLine, + "DeleteLine": (*BufPane).DeleteLine, + "MoveLinesUp": (*BufPane).MoveLinesUp, + "MoveLinesDown": (*BufPane).MoveLinesDown, + "IndentSelection": (*BufPane).IndentSelection, + "OutdentSelection": (*BufPane).OutdentSelection, + "Autocomplete": (*BufPane).Autocomplete, + "CycleAutocompleteBack": (*BufPane).CycleAutocompleteBack, + "OutdentLine": (*BufPane).OutdentLine, + "IndentLine": (*BufPane).IndentLine, + "Paste": (*BufPane).Paste, + "PastePrimary": (*BufPane).PastePrimary, + "SelectAll": (*BufPane).SelectAll, + "OpenFile": (*BufPane).OpenFile, + "Start": (*BufPane).Start, + "End": (*BufPane).End, + "PageUp": (*BufPane).PageUp, + "PageDown": (*BufPane).PageDown, + "SelectPageUp": (*BufPane).SelectPageUp, + "SelectPageDown": (*BufPane).SelectPageDown, + "HalfPageUp": (*BufPane).HalfPageUp, + "HalfPageDown": (*BufPane).HalfPageDown, + "StartOfText": (*BufPane).StartOfText, + "StartOfTextToggle": (*BufPane).StartOfTextToggle, + "StartOfLine": (*BufPane).StartOfLine, + "EndOfLine": (*BufPane).EndOfLine, + "ToggleHelp": (*BufPane).ToggleHelp, + "ToggleKeyMenu": (*BufPane).ToggleKeyMenu, + "ToggleDiffGutter": (*BufPane).ToggleDiffGutter, + "ToggleRuler": (*BufPane).ToggleRuler, + "ToggleHighlightSearch": (*BufPane).ToggleHighlightSearch, + "UnhighlightSearch": (*BufPane).UnhighlightSearch, + "ResetSearch": (*BufPane).ResetSearch, + "ClearStatus": (*BufPane).ClearStatus, + "ShellMode": (*BufPane).ShellMode, + "CommandMode": (*BufPane).CommandMode, + "ToggleOverwriteMode": (*BufPane).ToggleOverwriteMode, + "Escape": (*BufPane).Escape, + "Quit": (*BufPane).Quit, + "QuitAll": (*BufPane).QuitAll, + "ForceQuit": (*BufPane).ForceQuit, + "AddTab": (*BufPane).AddTab, + "PreviousTab": (*BufPane).PreviousTab, + "NextTab": (*BufPane).NextTab, + "NextSplit": (*BufPane).NextSplit, + "PreviousSplit": (*BufPane).PreviousSplit, + "Unsplit": (*BufPane).Unsplit, + "VSplit": (*BufPane).VSplitAction, + "HSplit": (*BufPane).HSplitAction, + "ToggleMacro": (*BufPane).ToggleMacro, + "PlayMacro": (*BufPane).PlayMacro, + "Suspend": (*BufPane).Suspend, + "ScrollUp": (*BufPane).ScrollUpAction, + "ScrollDown": (*BufPane).ScrollDownAction, + "SpawnMultiCursor": (*BufPane).SpawnMultiCursor, + "SpawnMultiCursorUp": (*BufPane).SpawnMultiCursorUp, + "SpawnMultiCursorDown": (*BufPane).SpawnMultiCursorDown, + "SpawnMultiCursorSelect": (*BufPane).SpawnMultiCursorSelect, + "RemoveMultiCursor": (*BufPane).RemoveMultiCursor, + "RemoveAllMultiCursors": (*BufPane).RemoveAllMultiCursors, + "SkipMultiCursor": (*BufPane).SkipMultiCursor, + "JumpToMatchingBrace": (*BufPane).JumpToMatchingBrace, + "JumpLine": (*BufPane).JumpLine, + "Deselect": (*BufPane).Deselect, + "ClearInfo": (*BufPane).ClearInfo, + "None": (*BufPane).None, // This was changed to InsertNewline but I don't want to break backwards compatibility "InsertEnter": (*BufPane).InsertNewline, @@ -864,64 +868,65 @@ var BufMouseActions = map[string]BufMouseAction{ // Generally actions that modify global editor state like quitting or // saving should not be included in this list var MultiActions = map[string]bool{ - "CursorUp": true, - "CursorDown": true, - "CursorPageUp": true, - "CursorPageDown": true, - "CursorLeft": true, - "CursorRight": true, - "CursorStart": true, - "CursorEnd": true, - "SelectToStart": true, - "SelectToEnd": true, - "SelectUp": true, - "SelectDown": true, - "SelectLeft": true, - "SelectRight": true, - "WordRight": true, - "WordLeft": true, - "SubWordRight": true, - "SubWordLeft": true, - "SelectWordRight": true, - "SelectWordLeft": true, - "SelectSubWordRight": true, - "SelectSubWordLeft": true, - "DeleteWordRight": true, - "DeleteWordLeft": true, - "DeleteSubWordRight": true, - "DeleteSubWordLeft": true, - "SelectLine": true, - "SelectToStartOfLine": true, - "SelectToStartOfText": true, - "SelectToStartOfTextToggle": true, - "SelectToEndOfLine": true, - "ParagraphPrevious": true, - "ParagraphNext": true, - "InsertNewline": true, - "Backspace": true, - "Delete": true, - "InsertTab": true, - "FindNext": true, - "FindPrevious": true, - "CopyLine": true, - "Copy": true, - "Cut": true, - "CutLine": true, - "DuplicateLine": true, - "DeleteLine": true, - "MoveLinesUp": true, - "MoveLinesDown": true, - "IndentSelection": true, - "OutdentSelection": true, - "OutdentLine": true, - "IndentLine": true, - "Paste": true, - "PastePrimary": true, - "SelectPageUp": true, - "SelectPageDown": true, - "StartOfLine": true, - "StartOfText": true, - "StartOfTextToggle": true, - "EndOfLine": true, - "JumpToMatchingBrace": true, + "CursorUp": true, + "CursorDown": true, + "CursorPageUp": true, + "CursorPageDown": true, + "CursorLeft": true, + "CursorRight": true, + "CursorStart": true, + "CursorEnd": true, + "SelectWord": true, + "SelectToStart": true, + "SelectToEnd": true, + "SelectUp": true, + "SelectDown": true, + "SelectLeft": true, + "SelectRight": true, + "WordRight": true, + "WordLeft": true, + "SubWordRight": true, + "SubWordLeft": true, + "SelectWordRight": true, + "SelectWordLeft": true, + "SelectSubWordRight": true, + "SelectSubWordLeft": true, + "DeleteWordRight": true, + "DeleteWordLeft": true, + "DeleteSubWordRight": true, + "DeleteSubWordLeft": true, + "SelectLine": true, + "SelectToStartOfLine": true, + "SelectToStartOfText": true, + "SelectToStartOfTextToggle": true, + "SelectToEndOfLine": true, + "ParagraphPrevious": true, + "ParagraphNext": true, + "InsertNewline": true, + "Backspace": true, + "Delete": true, + "InsertTab": true, + "FindNext": true, + "FindPrevious": true, + "CopyLine": true, + "Copy": true, + "Cut": true, + "CutLine": true, + "DuplicateLine": true, + "DeleteLine": true, + "MoveLinesUp": true, + "MoveLinesDown": true, + "IndentSelection": true, + "OutdentSelection": true, + "OutdentLine": true, + "IndentLine": true, + "Paste": true, + "PastePrimary": true, + "SelectPageUp": true, + "SelectPageDown": true, + "StartOfLine": true, + "StartOfText": true, + "StartOfTextToggle": true, + "EndOfLine": true, + "JumpToMatchingBrace": true, } diff --git a/internal/buffer/cursor.go b/internal/buffer/cursor.go index 7070dc238..75f85cf27 100644 --- a/internal/buffer/cursor.go +++ b/internal/buffer/cursor.go @@ -14,6 +14,31 @@ func InBounds(pos Loc, buf *Buffer) bool { return true } +// GetWordLocations returns the location boundaries for a word under the cursor +func GetWordLocations(c *Cursor) ([2]Loc, bool) { + if len(c.buf.LineBytes(c.Y)) == 0 { + return [2]Loc{}, false + } + if !util.IsWordChar(c.RuneUnder(c.X)) { + return [2]Loc{}, false + } + + forward, backward := c.X, c.X + + var locs [2]Loc + for backward > 0 && util.IsWordChar(c.RuneUnder(backward-1)) { + backward-- + } + locs[0] = Loc{backward, c.Y} + + lineLen := util.CharacterCount(c.buf.LineBytes(c.Y)) - 1 + for forward < lineLen && util.IsWordChar(c.RuneUnder(forward+1)) { + forward++ + } + locs[1] = Loc{forward, c.Y}.Move(1, c.buf) + return locs, true +} + // The Cursor struct stores the location of the cursor in the buffer // as well as the selection type Cursor struct { @@ -325,36 +350,28 @@ func (c *Cursor) Relocate() { // SelectWord selects the word the cursor is currently on func (c *Cursor) SelectWord() { - if len(c.buf.LineBytes(c.Y)) == 0 { - return - } - - if !util.IsWordChar(c.RuneUnder(c.X)) { - c.SetSelectionStart(c.Loc) - c.SetSelectionEnd(c.Loc.Move(1, c.buf)) - c.OrigSelection = c.CurSelection + locations, found := GetWordLocations(c) + if !found { return } - forward, backward := c.X, c.X - - for backward > 0 && util.IsWordChar(c.RuneUnder(backward-1)) { - backward-- - } - - c.SetSelectionStart(Loc{backward, c.Y}) + c.SetSelectionStart(locations[0]) c.OrigSelection[0] = c.CurSelection[0] - lineLen := util.CharacterCount(c.buf.LineBytes(c.Y)) - 1 - for forward < lineLen && util.IsWordChar(c.RuneUnder(forward+1)) { - forward++ - } - - c.SetSelectionEnd(Loc{forward, c.Y}.Move(1, c.buf)) + c.SetSelectionEnd(locations[1]) c.OrigSelection[1] = c.CurSelection[1] c.Loc = c.CurSelection[1] } +// GetWord returns the word the cursor is currently on +func (c *Cursor) GetWord() []byte { + locations, found := GetWordLocations(c) + if !found { + return []byte{} + } + return c.buf.Substr(locations[0], locations[1]) +} + // AddWordToSelection adds the word the cursor is currently on // to the selection func (c *Cursor) AddWordToSelection() { diff --git a/runtime/help/keybindings.md b/runtime/help/keybindings.md index 0f327ea63..4c688f43e 100644 --- a/runtime/help/keybindings.md +++ b/runtime/help/keybindings.md @@ -168,6 +168,9 @@ CursorLeft CursorRight CursorStart CursorEnd +SelectWord +SelectNextTextOccurrence +SelectPreviousTextOccurrence SelectToStart SelectToEnd SelectUp @@ -204,6 +207,7 @@ SaveAll SaveAs Find FindLiteral +FindSelected FindNext FindPrevious DiffPrevious