helix/helix-term/src
Matouš Dzivjak 2e02a1d6bc
feat(commands): shrink_selection (#1340)
* feat(commands): shrink_selection

Add `shrink_selection` command that can be used to shrink
previously expanded selection.

To make `shrink_selection` work it was necessary to add
selection history to the Document since we want to shrink
the selection towards the syntax tree node that was initially
selected.

Selection history is cleared any time the user changes
selection other way than by `expand_selection`. This ensures
that we don't get some funky edge cases when user calls
`shrink_selection`.

Related: https://github.com/helix-editor/helix/discussions/1328

* Refactor shrink_selection, move history to view

* Remove useless comment

* Add default key mapping for extend&shrink selection

* Rework contains_selection method

* Shrink selection without expand selects first child
2022-01-06 11:12:02 +09:00
..
ui fix: Use std::path::MAIN_SEPARATOR to determine completion 2022-01-06 11:03:54 +09:00
application.rs feat(lsp): configurable diagnostic severity (#1325) 2021-12-25 14:32:43 +09:00
args.rs Implement `hx --tutor` and `:tutor` to load `tutor.txt` (#898) 2021-10-28 10:23:46 +09:00
commands.rs feat(commands): shrink_selection (#1340) 2022-01-06 11:12:02 +09:00
compositor.rs Macros (#1234) 2021-12-12 21:16:48 +09:00
config.rs Launch with defaults upon invalid config/theme (#982) 2021-11-07 00:57:14 +09:00
job.rs Drop some &mut bounds where & would have sufficed 2021-09-06 15:25:46 +09:00
keymap.rs feat(commands): shrink_selection (#1340) 2022-01-06 11:12:02 +09:00
lib.rs Assume true color support on Windows 2021-12-14 00:48:45 +09:00
main.rs revert log truncation (#895) (#1130) 2021-11-19 13:26:39 +09:00