aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands.rs
Commit message (Collapse)AuthorAge
* open urls with goto_file command (#5820)Matouš Dzivjak2023-11-21
| | | | | | | | | | | | | | | | * feat(commands): open urls with goto_file command Add capability for `goto_file` command to open an URL under cursor. Fixes: https://github.com/helix-editor/helix/issues/1472 Superseds: https://github.com/helix-editor/helix/pull/4398 * open files inside helix * address code review * bump deps * fix based on code review comments
* make increment/decrement exit select modeRyan Mehri2023-11-18
|
* make switch case commands exit select modeRyan Mehri2023-11-18
|
* make align exit select modeRyan Mehri2023-11-18
|
* make replace with clipboard commands exit select modeRyan Mehri2023-11-18
|
* make paste commands exit select modeRyan Mehri2023-11-18
|
* make indent/unindent exit select modeRyan Mehri2023-11-18
|
* swap yank command registers (#8708)Skyler Hawthorne2023-11-04
| | | | #8703 swapped the `+` and `*` registers, but did not swap them in the corresponding yank commands.
* Add helix-specific ignore files (#8099)Paul Olteanu2023-10-21
|
* Maintain the current cursor's position and view in the vsplit/hsplit ↵Lorenzo Bellina2023-09-04
| | | | | | commands too (#8109) Co-authored-by: Benjamin Bouvier <public@benj.me>
* Fix find commands for buffers with non-LF line-endings (#8111)woojiq2023-09-03
|
* transition to nucleo for fuzzy matching (#7814)Pascal Kuthe2023-08-30
| | | | | | | | | | | | | | | | | | * transition to nucleo for fuzzy matching * drop flakey test case since the picker streams in results now any test that relies on the picker containing results is potentially flakely * use crates.io version of nucleo * Fix typo in commands.rs Co-authored-by: Skyler Hawthorne <skyler@dead10ck.com> --------- Co-authored-by: Skyler Hawthorne <skyler@dead10ck.com>
* goto_file_impl: use relative path to open file (#7965)Mike2023-08-21
| | | Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* goto_file: open picker if a directory is selected (#7909)Andrés Cabero2023-08-15
| | | | | * feat: open file picker on directories using goto_file (gf) * remove helper and call to canonicalize
* Make editor remember the latest search register (#5244)Jonathan LEI2023-08-14
|
* Fix YAML auto indentSkyler Hawthorne2023-08-10
| | | | | | | | | YAML indents queries are tweaked to fix auto indent behavior. A new capture type `indent.always` is introduced to address use cases where combining indent captures on a single line is desired. Fixes #6661
* Align view for background buffer opened with `alt-ret` (#7691)woojiq2023-08-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix(picker): `alt-ret' changes cursor pos of current file, not new one Closes #7673 * fix other pickers * symbol pickers * diagnostick pickers This is done using the already patched `jump_to_location` method. * fix global and jumplist pickers * use `view` as old_id; make `align_view` method of `Action` * test(picker): basic <alt-ret> functionality * fix: picker integrational test * fix nit Co-authored-by: Michael Davis <mcarsondavis@gmail.com> --------- Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* fix range formatting error message typo (#7823)Austin L Wolfgram2023-08-04
|
* feat: smart_tabSkyler Hawthorne2023-08-01
| | | | | | Implement `smart_tab`, which optionally makes the tab key run the `move_parent_node_start` command when the cursor has non- whitespace to its left.
* add node boundary movementSkyler Hawthorne2023-08-01
|
* Add yank_to_clipboard commands, bind to `<space>y` by defaultMichael Davis2023-07-31
| | | | | | | | The clipboard special registers are able to retain multiple selections and also join the value when copying it to the clipboard. So by default we should yank regularly to the '*' and '+' registers. That will have the same behavior for the clipboards but will allow pasting multiple selections if the clipboard doesn't change between yanks.
* Reimplement clipboard commands in terms of special regsMichael Davis2023-07-31
| | | | | | | | | | Since the clipboard provider now lives on the Registers type, we want to eliminate it from the Editor. We can do that and clean up the commands that interact with the clipboard by calling regular yank, paste and replace impls on the clipboard special registers. Eventually the clipboard commands could be removed once macro keybinding is supported.
* Preview the latest value for regular registersMichael Davis2023-07-31
| | | | | | | | | | | | | | | | | | | | | | | This fixes a discrepancy between regular registers which are used for yanking multiple values (for example via `"ay`) and regular registers that store a history of values (for example `"a*`). Previously, the preview shown in `select_register`'s infobox would show the oldest value in history. It's intuitive and useful to see the most recent value pushed to the history though. We cannot simply switch the preview line from `values.first()` to `values.last()`: that would fix the preview for registers used for history but break the preview for registers used to yank multiple values. We could push to the beginning of the values with `Registers::push` but this is wasteful from a performance perspective. Instead we can have `Registers::read` return an iterator that returns elements in the reverse order and reverse the values in `Register::write`. This effectively means that `push` adds elements to the beginning of the register's values. For the sake of the preview, we can switch to `values.last()` and that is then correct for both usage- styles. This also needs a change to call-sites that read the latest history value to switch from `last` to `first`.
* commands: Allow using selected register where hardcodedMichael Davis2023-07-31
| | | | | These snippets use hardcoded registers but it can be useful to be able to specify a register for these commands.
* Use refactored Registers typeMichael Davis2023-07-31
| | | | | | | This is an unfortunately noisy change: we need to update virtually all callsites that access the registers. For reads this means passing in the Editor and for writes this means handling potential failure when we can't write to a clipboard register.
* enhanced `surround_replace` to provide visual feedback (#7588)Alex Vinyals2023-07-13
|
* Auto indent change if selection is linewise (#7316)Tudyx2023-07-11
|
* Fix crash when cwd is deleted (#7185)Yomain2023-07-11
|
* search buffer contents during global search (#5652)Pascal Kuthe2023-07-11
|
* (Updated) Apply motion API refinements (#6078)Gabriel Hansson2023-07-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * _apply_motion generalization where possible API encourages users to not forget setting `editor.last_motion` when applying a motion. But also not setting `last_motion` without applying a motion first. * (rename) will_find_char -> find_char method name makes it sound like it would be returning a boolean. * use _apply_motion in find_char Feature that falls out from this is that repetitions of t,T,f,F are saved with the context extention/move and count. (Not defaulting to extend by 1 count). * Finalize apply_motion API last_motion is now a private field and can only be set by calling Editor.apply_motion(). Removing need (and possibility) of writing: `motion(editor); editor.last_motion = motion` Now it's just: `editor.apply_motion(motion)` * editor.last_message: rm Box wrap around Arc * Use pre-existing `Direction` rather than custom `SearchDirection`. * `LastMotion` type alias for `Option<Arc<dyn Fn(&mut Editor)>>` * Take motion rather than cloning it. Co-authored-by: Michael Davis <mcarsondavis@gmail.com> * last_motion as Option<Motion>. * Use `Box` over `Arc` for `last_motion`. --------- Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Add filename completer for shell prompt (#7569)Alberto Romero2023-07-08
|
* make TS matching fallback to plaintextPascal Kuthe2023-06-22
|
* Completely remove old Picker and rename FilePicker to PickerGokul Soumya2023-06-18
|
* Make file preview callback optionalMichael Davis2023-06-18
| | | | | | | When Picker and FilePicker are merged, not all Pickers will be able to show a preview. Co-authored-by: Gokul Soumya <gokulps15@gmail.com>
* Add yank_joined command (#7195)spectre2562023-06-16
| | | | | Resolves issue #6888 by adding a command to join all selections and yank them to the specified register. The typed command takes an argument as the separator to use when joining the selections.
* Preview scratch buffers in jumplist picker (#7331)A-Walrus2023-06-13
|
* Add reverse_selection_contents (#7329)Robert2023-06-13
|
* Auto indent on `insert_at_line_start` (#5837)Alex2023-06-08
|
* add move_prev_long_word_end and extend_prev_long_word_end (#6905)vwkd2023-06-07
|
* Propagate the count and register to command palette commandsMichael Davis2023-06-07
| | | | | | Previously a count or register selection would be lost while opening the command palette. This change allows using a register selection or count in any command chosen from the command palette.
* feat(core): add plaintext matching fallback to tree-sitter matching (#4288)Alex Vinyals2023-06-05
|
* fixed repeat_last_motion extends selection (#7159)Ethan Wilkes2023-05-28
|
* Add command to merge non-consecutive ranges (#7053)Szabin2023-05-19
| | | | | | | | | | | * Add command for merging non-consecutive ranges * Add `merge_selections` command to book * Simplify `merge_ranges` Heeded the advice of @the-mikedavis to stop iterating over all ranges and simply merge the first and the last range, as the invariants of `Selection` guarantee that the list of ranges is always sorted and never empty. * Clarify doc comment of `merge_ranges`
* Rebase cleanup/fixes and use lsp::CompletionItem in item_to_transaction directlyPhilipp Mildenberger2023-05-18
|
* Filter language servers also by capabilities in ↵Philipp Mildenberger2023-05-18
| | | | | | | | | `doc.language_servers_with_feature` * Add `helix_lsp::client::Client::supports_feature(&self, LanguageServerFeature)` * Extend `doc.language_servers_with_feature` to use this method as filter as well * Add macro `language_server_with_feature!` to reduce boilerplate for non-mergeable language server requests (like goto-definition) * Refactored most of the `find_map` code to use the either the macro or filter directly via `doc.language_servers_with_feature`
* Filter out already seen language servers in requests that can be sent to ↵Philipp Mildenberger2023-05-18
| | | | multiple language servers (code-action, completion, symbol pickers)
* Use let else instead of variable and fix some error messagesPhilipp Mildenberger2023-05-18
| | | | Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>
* Remove offset_encoding in CompletionItemPhilipp Mildenberger2023-05-18
|
* Refactored doc.language_servers and doc.language_servers_with_feature to ↵Philipp Mildenberger2023-05-18
| | | | | | return an iterator and refactor LanguageServerFeature handling to a HashMap (language server name maps to features) Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>
* Use DoubleEndedIterator instead of collect to Vec for reversingPhilipp Mildenberger2023-05-18
| | | | Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>