aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands.rs
Commit message (Collapse)AuthorAge
* lsp: Check bounds when converting lsp positions (#204)Wojciech Kępka2021-06-12
| | | | | | | | | * lsp: Make position conversion funcs return `Option` * Add tests * Fixes * Revert pos_to_lsp_pos to panic
* Only auto-format for certain languagesBlaž Hrastnik2021-06-12
| | | | | Fixes #53 Fixes #207
* Add :earlier and :later commands that can be used to navigate the full edit ↵Jakub Bartodziej2021-06-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Movement fixes, refactor and unit test suite (#217)PabloMansanet2021-06-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* commands: Handle `t<ENTER>` as till newlineWojciech Kępka2021-06-11
|
* move to first nonwhitespace on shift-iRobin van Dijk2021-06-10
| | | | This matches the behaviour in vim and kak
* Fix jump behavior, goto_implementation now jumpIvan Tham2021-06-10
| | | | | Better jump behavior since we override the first jump if it's on the first document. At the same time, ctrl-i is now working with gd jumps.
* Support go to line 1Zheming Li2021-06-08
|
* Make `r<ENTER>` workWojciech Kępka2021-06-08
|
* Remove unwanted `as_str`Wojciech Kępka2021-06-08
|
* Don't replace newlinesWojciech Kępka2021-06-08
|
* Add bounds checks to replaceWojciech Kępka2021-06-08
|
* commands: Replace all characters in selectionWojciech Kępka2021-06-08
|
* Cleanup find_first_non_whitespace_char funcsWojciech Kępka2021-06-08
|
* commands: Add goto first non-whitespace char of lineWojciech Kępka2021-06-08
|
* Fix Unicode (#135)Kirawi2021-06-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * init * wip * wip * fix unicode break * fix unicode break * Update helix-core/src/transaction.rs Co-authored-by: Benoît Cortier <benoit.cortier@fried-world.eu> * clippy * fix * add changes * added test * wip * wip * wip * wip * fix * fix view * fix #88 Co-authored-by: Benoît Cortier <benoit.cortier@fried-world.eu>
* commands: Add replace with yanked as `R`Wojciech Kępka2021-06-08
|
* ui: completion: Use the correct type_nameBlaž Hrastnik2021-06-07
| | | | Fixes #166
* Make gh/gl extend selection in select modeBlaž Hrastnik2021-06-07
|
* Implement register selectionBenoît CORTIER2021-06-07
| | | | | | User can select register to yank into with the " command. A new state is added to `Editor` and `commands::Context` structs. This state is managed by leveraging a new struct `RegisterSelection`.
* lsp: Provide workspace root on client.initialize()Blaž Hrastnik2021-06-07
|
* View mode: Use saturating_sub when calculating first_colBlaž Hrastnik2021-06-07
|
* commands: use chars().count() over .len() on stringsBlaž Hrastnik2021-06-07
|
* Add diagnostics keybindingsWojciech Kępka2021-06-07
|
* Add spc w w for window modeIvan Tham2021-06-07
|
* Add ctrl-w in insert modeIvan Tham2021-06-06
| | | | | It seemed to panic when I pressed too many times, but that is from lsp side.
* Add window modeIvan Tham2021-06-06
| | | | Fix #93
* fix: make find_prev_char and till_prev_char workahkrr2021-06-05
| | | | | | Bevore this PR `commands::find_prev_char` and `commands::till_prev_char` were triggerable through keys but `seach::find_nth_next()` was hardcoded in `_find_char`. The passed `fn` was nerver used. With this PR the passed `fn` is used. The change in search.rs resolves an off by one error in the behivor of `find_nth_prev`
* Fixing Multiple Panics (#121)Kirawi2021-06-05
| | | | | | | * init * wip * wip
* Add home-end keymaps, (as kakoune/vim do) (#83)Antoni Stevenet2021-06-05
| | | | | | | | | | | * add home-end keymaps * implement extend methods for extend_line_start, extend_line_end * add home-end mappings to keymaps.md * add ^-$ extend mappings for extend mode * pass cargo linter
* Replace ^/$ with gh/glnotoria2021-06-04
|
* Implement gt/gm/gb, remap goto tYpe to gyBlaž Hrastnik2021-06-04
|
* scroll: Fix the clampingBlaž Hrastnik2021-06-04
|
* Exit select mode on delete_selectionBlaž Hrastnik2021-06-04
|
* Limit goto countKevin Sjöberg2021-06-03
| | | | | Giving a goto count greater than the number of lines in the buffer would cause Helix to panic.
* Avoid theoretical underflow.Jakub Bartodziej2021-06-03
|
* Clean up leftover log.Jakub Bartodziej2021-06-03
|
* Improve on the fix for deleting from the end of the buffer.Jakub Bartodziej2021-06-03
|
* Disable deleting from an empty buffer which can cause a crash.Jakub Bartodziej2021-06-03
|
* Support ctrl-f and ctrl-b to page up/down, fixes #41Blaž Hrastnik2021-06-02
|
* Fix empty command cause panicDaichi Takamiya2021-06-02
|
* Allow setting a filepath on :writeBlaž Hrastnik2021-06-01
|
* Don't crash if no filename specified on openBlaž Hrastnik2021-06-01
|
* Format document on saveBlaž Hrastnik2021-05-29
|
* Update deps, introduce the new tree-sitter lifetimesBlaž Hrastnik2021-05-27
|
* Support count for indent tooBlaž Hrastnik2021-05-18
|
* Fix unindent to work with tabs, take a countBlaž Hrastnik2021-05-18
|
* Drop selection_lines completely, change move_line_start bindingBlaž Hrastnik2021-05-18
|
* Fix crash if appending at end of line on the last line of the fileBlaž Hrastnik2021-05-18
|
* Append :fmt as a separate history stateBlaž Hrastnik2021-05-18
|