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.
helix-plus/helix-term/src
Jason Hansen 6cb35d28a8
Add command to inc/dec number under cursor (#1027)
* Add command to inc/dec number under cursor

With the cursor over a number in normal mode, Ctrl + A will increment the
number and Ctrl + X will decrement the number. It works with binary, octal,
decimal, and hexidecimal numbers. Here are some examples.

0b01110100
0o1734
-24234
0x1F245

If the number isn't over a number it will try to find a number after the
cursor on the same line.

* Move several functions to helix-core

* Change to work based on word under selection

* It no longer finds the next number if the cursor isn't already over
  a number.
* It only matches numbers that are part of words with other characters
  like "foo123bar".
* It now works with multiple selections.

* Add some unit tests

* Fix for clippy

* Simplify some things

* Keep previous selection after incrementing

* Use short word instead of long word

This change requires us to manually handle minus sign.

* Don't pad decimal numbers if no leading zeros

* Handle numbers with `_` separators

* Refactor and add tests

* Move most of the code into core
* Add tests for the incremented output

* Use correct range

* Formatting

* Rename increment functions

* Make docs more specific

* This is easier to read

* This is clearer

* Type can be inferred
3 years ago
..
ui Readline style insert mode (#1039) 3 years ago
application.rs helix-term/commands: implement cquit (#1096) 3 years ago
args.rs Implement `hx --tutor` and `:tutor` to load `tutor.txt` (#898) 3 years ago
commands.rs Add command to inc/dec number under cursor (#1027) 3 years ago
compositor.rs Fix doctest broken on 2021 edition 3 years ago
config.rs Launch with defaults upon invalid config/theme (#982) 3 years ago
job.rs Drop some &mut bounds where & would have sufficed 3 years ago
keymap.rs Add command to inc/dec number under cursor (#1027) 3 years ago
lib.rs Remove #[allow(unused)] from helix-term, and fix unused imports. 3 years ago
main.rs helix-term/commands: implement cquit (#1096) 3 years ago