forked from Mirrors/helix
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
e0b5cdfb47
Inserting a newline currently collapses any connected selections when inserting or appending. It's happening because we're reducing the selections down to their cursors (`let selection = ..` line) and then computing the new selection based on the cursor. We're discarding the original head and anchor information which are necessary to emulate Kakoune's behavior. In Kakoune, inserting a newline retains the existing selection and _slides_ it (moves head and anchor by the same amount) forward by the newline and indentation amount. Appending a newline extends the selection to include the newline and any new indentation. With the implementation of insert_newline here, we slide by adding the global and local offsets to both head and anchor. We extend by adding the global offset to both head and anchor but the local offset only to the head. |
3 years ago | |
---|---|---|
.. | ||
commands | 3 years ago | |
keymap | 3 years ago | |
ui | 3 years ago | |
application.rs | 3 years ago | |
args.rs | 3 years ago | |
commands.rs | 3 years ago | |
compositor.rs | 3 years ago | |
config.rs | 3 years ago | |
health.rs | 3 years ago | |
job.rs | 3 years ago | |
keymap.rs | 3 years ago | |
lib.rs | 3 years ago | |
main.rs | 3 years ago |