helix/book
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
..
src feat(commands): shrink_selection (#1340) 2022-01-06 11:12:02 +09:00
theme Update mdbook style and fix unreadable table head (#806) 2021-10-09 20:35:27 +09:00
.gitignore Add book/ (mdbook based user guide) 2021-04-05 15:48:08 +09:00
book.toml Improve docs, fix up a few highlight scopes 2021-09-07 13:03:48 +09:00