Commit Graph

273 Commits (d94410a6782a2ac52dde2708fcadf9cbddfd8f93)

Author SHA1 Message Date
Blaž Hrastnik 1b102d5532 Extract the merge "operator" into helix-core 3 years ago
Blaž Hrastnik 44566ea812 Release 0.3.0 3 years ago
Nathan Vegdahl a6cadddef4 Fix silly mistake in previous phantom line bug fix.
Fixes #381.  I was trying to change an index value that... wasn't
even an index value.
3 years ago
Nathan Vegdahl 2dba228c76 Fix highlight code splitting graphemes.
This resulted in phantom blank lines in files with CRLF line
endings, but could potentially have manifested with other
graphemes as well.
3 years ago
Gokul Soumya 394629ab73 Skip enclosed pairs in surround
Surround operations previously ignored other pairs that are
enclosed within which should be skipped. For example if the
cursor is on the `,` in `{{a},{b}}`, doing `md{` previously
would delete the `{` on the left of `a` and `}` on the right
of `b` instead of the outermost braces. This commit corrects
this behavior.
3 years ago
Nathan Vegdahl 9cbf564d08 Handle erroneously ignored case in RopeGraphemes iterator. 3 years ago
Blaž Hrastnik 7f6265ecf3 fix: crash with ctrl-c on empty file 3 years ago
Shafkath Shuhan fd98e743e8 Handle non-UTF8 files 3 years ago
Nathan Vegdahl 38bf9c2576 Missed some items in the CRLF PR. 3 years ago
Blaž Hrastnik 9c53461429 fix: Select matching at the start of the doc could crash. Fixes #346 3 years ago
Gokul Soumya 892c80771a Correctly identify pairs when cursor on pair 3 years ago
Gokul Soumya 86271bac18 Refactor and add tests for surround 3 years ago
Gokul Soumya 4754b2e5ae Add more surround pair characters 3 years ago
Gokul Soumya 13648d28b9 Add surround keybinds 3 years ago
Nathan Vegdahl f2954fa153 Flesh out the line ending utility unit tests. 3 years ago
Nathan Vegdahl 7c4fa18764 Fix clippy warnings. 3 years ago
Nathan Vegdahl 07e28802f6 Add function to get the line ending of a str slice.
This is needed in some places.
3 years ago
Nathan Vegdahl 3d3149e0d5 Silence clippy warning. 3 years ago
Nathan Vegdahl e686c3e462 Merge branch 'master' of github.com:helix-editor/helix into line_ending_detection
Rebasing was making me manually fix conflicts on every commit, so
merging instead.
3 years ago
Nathan Vegdahl 4efd6713c5 Work on moving code over to LineEnding instead of assuming '\n'.
Also some general cleanup and some minor fixes along the way.
3 years ago
Nathan Vegdahl 5d22e3c4e5 Misc fixes and clean up of line ending detect code. 3 years ago
Blaž Hrastnik e9a3245aae Re-export unicode crates from helix_core 3 years ago
Jan Hrastnik 8634e04a31 added the line_end helper function 3 years ago
Jan Hrastnik 701eb0dd68 changed some hardcoded newlines, removed a else if in line_ending.rs 3 years ago
wojciechkepka 6825e19509 Only reconfiure highlights when setting theme 3 years ago
wojciechkepka ce97a2f05f Add ability to change theme on editor 3 years ago
Jan Hrastnik cdd9347457 Merge remote-tracking branch 'origin/master' into line_ending_detection 3 years ago
Jan Hrastnik 97323dc2f9 ran cargo fmt 3 years ago
Jan Hrastnik ecb884db98 added get_line_ending from pr comment 3 years ago
Wojciech Kępka 41b07486ad
Fix expansion of `~` (#284)
* Fix expansion of `~`, dont use directory relative to cwd.

* Add `expand_tilde`

* Bring back `canonicalize_path`, use `expand_tilde` to `normalize`

* Make `:open ~` completion work

* Fix clippy

* Fold home dir into tilde in Document `realitve_path`
3 years ago
Jan Hrastnik 8bccd6df30 applied changes from pr review 3 years ago
Jan Hrastnik a4f5a0134e trying out line ending helper functions in commands.rs 3 years ago
Jan Hrastnik a9a718c3ca added some tests and a line_ending helper function in document.rs 3 years ago
Jan Hrastnik e4849f41be fix typo 3 years ago
Jan Hrastnik 9c419fe05c added more changes from pr review for line_ending_detection 3 years ago
Jan Hrastnik 5eb6918392 resolved conflict in rebase 3 years ago
Jan Hrastnik 17f69a03e0 ran cargo clippy and cargo fmt 3 years ago
Jan Hrastnik 3756c21bae rebase on branch line_ending_detection 3 years ago
Benoît CORTIER 6bdf609caa Remove RwLock for registers
Registers are stored inside `Editor` and accessed without `RwLock`.
To work around ownership, I added a sister method to `Editor::current`:
`Editor::current_with_context`. I tried to modify `Editor::current`
directly but it's used at a lot of places so I reverted into this for
now at least.
3 years ago
Nathan Vegdahl 0a5580aa21 Address PR comments.
- Move char functions into their own module under helix_core.
- Use matches!() macro where appropriate.
- Use a static lifetime on indent_unit() now that we can.
3 years ago
Ivan Tham 1bda454149 Add ctrl-w for prompt 3 years ago
Wojciech Kępka 4b6aff8c66 Use `runtime` dir when defaulting to executable location 3 years ago
Wojciech Kępka 4a40e935de Make `runtime_dir` private 3 years ago
Wojciech Kępka 716067ba05 Add more ways to detect runtime directory 3 years ago
Blaž Hrastnik 1665bac1b6 Fix broken test 3 years ago
Blaž Hrastnik 278361a086 Only auto-format for certain languages
Fixes #53
Fixes #207
3 years ago
Jakub Bartodziej 69fe46a122
Add :earlier and :later commands that can be used to navigate the full edit history. (#194)
* Disable deleting from an empty buffer which can cause a crash.

* Improve on the fix for deleting from the end of the buffer.

* Clean up leftover log.

* Avoid theoretical underflow.

* Implement :before which accepts a time interval and moves the editor to
the closest history state to the commit of the current time minus that
interval. Current time is now by default, or the commit time if :before
has just been used.

* Add :earlier an :later commands that can move through
the edit history and retrieve changes hidded by undoing
and commiting new changes. The commands accept a number
of steps or a time period relative to the currrent change.

* Fix clippy lint error.

* Remove the dependency on parse_duration, add a custom parser instead.

* Fix clippy errors.

* Make helix_core::history a public module.

* Use the helper for getting the current document and view.

* Handled some PR comments.

* Fix the logic in :later n.

Co-authored-by: Ivan Tham <pickfire@riseup.net>

* Add an alias for :earlier.

Co-authored-by: Ivan Tham <pickfire@riseup.net>

* Add an alias for later.

Co-authored-by: Ivan Tham <pickfire@riseup.net>

* Run cargo fmt.

* Add some tests for earlier and later.

* Add more tests and restore the fix for later that diappeared somehow.

* Use ? instead of a match on an option.

Co-authored-by: Ivan Tham <pickfire@riseup.net>

* Rename to UndoKind.

* Remove the leftover match.

* Handle a bunch of review comments.

* More systemd.time compliant time units and additional description for the new commands.

* A more concise rewrite of the time span parser using ideas from PR discussion.

* Replace a match with map_err().

Co-authored-by: Ivan Tham <pickfire@riseup.net>

Co-authored-by: Jakub Bartodziej <jqb@google.com>
Co-authored-by: Ivan Tham <pickfire@riseup.net>
3 years ago
PabloMansanet 86af55c379
Movement fixes, refactor and unit test suite (#217)
* Add convenience/clarity wrapper for Range initialization

* Test horizontal moves

* Add column jumping tests

* Add failing movement conditions for multi-word moves

* Refactor skip_over_next

* Add complex forward movement unit tests

* Add strict whitespace checks and edge case tests

* Restore formatting

* Remove unused function

* Add empty test case for deletion and fix nth_prev_word_boundary

* Add tests for backward motion

* Refactor word movement

* Address review comments and finish refactoring backwards move

* Finish unit test suite

* Fmt pass

* Fix lint erors

* Clean up diff restoring bad 'cargo fmt' actions

* Simplify movement closures (thanks Pickfire)

* Fmt pass

* Replace index-based movement with iterator based movement, ensuring that each move incurs a single call to the RopeSlice API

* Break down tuple function

* Extract common logic to all movement functions

* Split iterator helpers away into their own module

* WIP reducing clones

* Operate on spans

* WIP simplifying iterators

* Simplify motion helpers

* Fix iterator

* Fix all unit tests

* Refactor and simplify

* Simplify fold
3 years ago
notoria 1b14e9a19a Downgrade `unicode-segmentation` 3 years ago
Ivan Tham 7cc13fefe9 Derive debug without feature
Note that this also removed those `finish_non_exhaustive()`.
3 years ago