helix/helix-core/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
..
increment Remove `Clone` derive 2021-12-05 16:22:58 +08:00
auto_pairs.rs Auto pairs selection (#1254) 2021-12-21 18:17:33 +09:00
chars.rs Document more of helix-core (#904) 2021-10-26 01:02:16 +09:00
comment.rs Specify capacity on toggle_line_comments 2021-11-08 10:03:21 +09:00
diagnostic.rs feat(lsp): configurable diagnostic severity (#1325) 2021-12-25 14:32:43 +09:00
diff.rs Remove ExactSizeIterator requirement on Transaction::change 2021-07-19 11:29:51 +09:00
graphemes.rs Add hyperlinks to fix `cargo doc` warn (#931) 2021-10-29 09:55:15 +09:00
history.rs Add movement shortcut for history (#1088) 2021-11-15 00:16:47 +09:00
indent.rs Add llvm-mir highlighting (#1398) 2022-01-04 10:52:34 +09:00
lib.rs Detect workspace root using language markers (#1370) 2021-12-31 17:06:54 +09:00
line_ending.rs Mark a few functions as `const` 2021-10-24 17:28:29 +09:00
macros.rs Split parts of helix-term into helix-view. 2020-09-21 18:24:16 +09:00
match_brackets.rs Fix match brackets comment (#1346) 2021-12-24 07:27:31 +05:30
movement.rs Apply recent nightly suggestions (#1286) 2021-12-18 14:57:49 +09:00
object.rs feat(commands): shrink_selection (#1340) 2022-01-06 11:12:02 +09:00
path.rs fix: Expand tilde first, then deal with relative paths 2021-11-19 12:09:17 +09:00
position.rs Ensure coords in screen depends on char width (#885) 2021-11-03 12:02:29 +09:00
register.rs Implement black hole register (#1165) 2021-11-28 10:21:40 +09:00
search.rs Switch to a cleaner range-head moving abstraction. 2021-07-24 07:44:11 -07:00
selection.rs feat(commands): shrink_selection (#1340) 2022-01-06 11:12:02 +09:00
shellwords.rs Open files with spaces in filename, allow opening multiple files (#1231) 2021-12-12 21:13:33 +09:00
state.rs Reduce State use a bit further 2021-08-26 09:21:07 +09:00
surround.rs Fix surround cursor position calculation (#1183) 2021-11-29 10:33:53 +09:00
syntax.rs Add llvm-mir highlighting (#1398) 2022-01-04 10:52:34 +09:00
textobject.rs Fix surround cursor position calculation (#1183) 2021-11-29 10:33:53 +09:00
transaction.rs Add auto pairs for same-char pairs (#1219) 2021-12-14 00:58:58 +09:00