[PR #13765] [MERGED] Introduce ExpandSelectionToWord action #29759

Open
opened 2026-01-31 09:36:44 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/13765
Author: @carlos-zamora
Created: 8/17/2022
Status: Merged
Merged: 8/31/2022
Merged by: @undefined

Base: mainHead: dev/cazamor/expand-sln-action


📝 Commits (3)

  • f9d118d Introduce ExpandSelectionToWord action
  • 9fd779a Merge branch 'main' into dev/cazamor/expand-sln-action
  • 09197e6 Merge branch 'main' into dev/cazamor/expand-sln-action

📊 Changes

14 files changed (+49 additions, -0 deletions)

View changed files

📝 doc/cascadia/profiles.schema.json (+1 -0)
📝 src/cascadia/TerminalApp/AppActionHandlers.cpp (+10 -0)
📝 src/cascadia/TerminalControl/ControlCore.cpp (+11 -0)
📝 src/cascadia/TerminalControl/ControlCore.h (+1 -0)
📝 src/cascadia/TerminalControl/ControlCore.idl (+1 -0)
📝 src/cascadia/TerminalControl/TermControl.cpp (+5 -0)
📝 src/cascadia/TerminalControl/TermControl.h (+1 -0)
📝 src/cascadia/TerminalControl/TermControl.idl (+1 -0)
📝 src/cascadia/TerminalCore/Terminal.hpp (+1 -0)
📝 src/cascadia/TerminalCore/TerminalSelection.cpp (+10 -0)
📝 src/cascadia/TerminalSettingsModel/ActionAndArgs.cpp (+2 -0)
📝 src/cascadia/TerminalSettingsModel/AllShortcutActions.h (+1 -0)
📝 src/cascadia/TerminalSettingsModel/Resources/en-US/Resources.resw (+3 -0)
📝 src/cascadia/TerminalSettingsModel/defaults.json (+1 -0)

📄 Description

Summary of the Pull Request

Introduces a new action expandSelectionToWord() which expands the beginning and end of the selection to encompass the word(s) it's on. This was implemented as a conditional keybinding where the key chord is passed through to the terminal if no selection is active (similar to copy()).
It is not bound to anything by default.

PR Checklist

Validation Steps Performed

  • Scenario in #8274:
    • search for some text in the find dialog
    • ESC to close the dialog
    • execute expandSelectionToWord()
    • the new selection encompasses the whole word
  • mark mode
    • move onto a word
    • execute expandSelectionToWord()
  • mouse selection (same as above)
  • select a portion of two words --> new selection fully encompasses both words

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/13765 **Author:** [@carlos-zamora](https://github.com/carlos-zamora) **Created:** 8/17/2022 **Status:** ✅ Merged **Merged:** 8/31/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/cazamor/expand-sln-action` --- ### 📝 Commits (3) - [`f9d118d`](https://github.com/microsoft/terminal/commit/f9d118dbabb2f9a8c80a4c624b7ad803480225d6) Introduce ExpandSelectionToWord action - [`9fd779a`](https://github.com/microsoft/terminal/commit/9fd779aad9f4751805abca773a9dafd5a140715e) Merge branch 'main' into dev/cazamor/expand-sln-action - [`09197e6`](https://github.com/microsoft/terminal/commit/09197e6724b868dee2563d6358a45c6781fe9537) Merge branch 'main' into dev/cazamor/expand-sln-action ### 📊 Changes **14 files changed** (+49 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `doc/cascadia/profiles.schema.json` (+1 -0) 📝 `src/cascadia/TerminalApp/AppActionHandlers.cpp` (+10 -0) 📝 `src/cascadia/TerminalControl/ControlCore.cpp` (+11 -0) 📝 `src/cascadia/TerminalControl/ControlCore.h` (+1 -0) 📝 `src/cascadia/TerminalControl/ControlCore.idl` (+1 -0) 📝 `src/cascadia/TerminalControl/TermControl.cpp` (+5 -0) 📝 `src/cascadia/TerminalControl/TermControl.h` (+1 -0) 📝 `src/cascadia/TerminalControl/TermControl.idl` (+1 -0) 📝 `src/cascadia/TerminalCore/Terminal.hpp` (+1 -0) 📝 `src/cascadia/TerminalCore/TerminalSelection.cpp` (+10 -0) 📝 `src/cascadia/TerminalSettingsModel/ActionAndArgs.cpp` (+2 -0) 📝 `src/cascadia/TerminalSettingsModel/AllShortcutActions.h` (+1 -0) 📝 `src/cascadia/TerminalSettingsModel/Resources/en-US/Resources.resw` (+3 -0) 📝 `src/cascadia/TerminalSettingsModel/defaults.json` (+1 -0) </details> ### 📄 Description ## Summary of the Pull Request Introduces a new action `expandSelectionToWord()` which expands the beginning and end of the selection to encompass the word(s) it's on. This was implemented as a conditional keybinding where the key chord is passed through to the terminal if no selection is active (similar to `copy()`). It is not bound to anything by default. ## PR Checklist * [x] Closes #8274 * [x] Schema updated. ## Validation Steps Performed - Scenario in #8274: - search for some text in the find dialog - ESC to close the dialog - execute `expandSelectionToWord()` - the new selection encompasses the whole word - mark mode - move onto a word - execute `expandSelectionToWord()` - mouse selection (same as above) - select a portion of two words --> new selection fully encompasses both words --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:36:44 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#29759