aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src
Commit message (Collapse)AuthorAge
* avoid excessive memory consumption in picker (#8127)Pascal Kuthe2023-09-01
| | | | | | | | | | | * avoid excessive memory consumption from file picker * fix typos Co-authored-by: Chris <75008413+cd-a@users.noreply.github.com> --------- Co-authored-by: Chris <75008413+cd-a@users.noreply.github.com>
* Clear completion when switching windows via click (#8118)Michael Davis2023-08-31
| | | | | | | | | | | | | | | | | The completion component assumes that it operates on the same View but it's possible to break this assumption by switching windows through left-clicking. I believe we should clear the completion menu when switching windows to fix this. This change fixes a panic for this scenario: * Open a buffer with LSP completion available * Split the window (for example '<C-w>v') * Enter insert mode and trigger the completion menu * Select a completion candidate (for example with '<C-n>') * Switch to the original window by left-clicking in its area * Enter insert mode and make edits (for example 'o<backspace>') This will trip the 'assert_eq' in Document::restore.
* 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>
* fix: line numbers remain relative when helix loses focus (#7955)woojiq2023-08-29
| | | | | | | * fix: line numbers remain relative when helix loses focus If `line number = relative` and a new window is opened in helix, lines inside unfocused windows will be `absolute`. This commit adds the same thing when helix becomes unfocused in a terminal emulator. * partial rebase
* Handle switch from crossterm::Result to io::ResultMichael Davis2023-08-22
|
* create separate timer for redraw requests (#8023)Pascal Kuthe2023-08-21
| | | | | | | | | | | * create separate timer for redraw requests * Update helix-view/src/editor.rs Co-authored-by: Michael Davis <mcarsondavis@gmail.com> --------- Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* goto_file_impl: use relative path to open file (#7965)Mike2023-08-21
| | | Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Remove unnecessary `Err` from `get_canonicalized_path` (#8009)nkitsaini2023-08-20
| | | | Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Remove path completions for `:new` command (#8010)nkitsaini2023-08-20
|
* 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
|
* Include completions for git-ignored files in debugger prompt (#7936)quantonganh2023-08-14
|
* Fix broken indentation that causes the indentation tests to fail.Daniel Ebert2023-08-11
| | | | | | For some reason, `cargo fmt` does not change the indentation in these places (maybe it isn't sure about what the correct formatting should be).
* 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
* Enhance :toggle to support cycling numbers (#7877)Alex Vinyals2023-08-09
|
* 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>
* Show whether file readonly in statusline (#7740)Connortsui202023-08-08
|
* Center the picker preview selection using visual lines (#7837)Jesse Luehrs2023-08-08
| | | | this way the preview always shows the selection even if lines were wrapped
* Skip rendering gutters when gutter width exceeds view width (#7821)Anshul Dalal2023-08-08
|
* 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.
* Reformat with nightly rustfmt for better let-else formatting (#7721)Philipp Mildenberger2023-07-27
|
* highlighted_code_block: Take input text as &strMichael Davis2023-07-27
| | | | | | This removes a handful of allocations for functions calling into the function, which is nice because the prompt may call this function on every keypress.
* Prefer RopeSlice to &Rope in helix_core::syntaxMichael Davis2023-07-27
| | | | | | | | | | | | | | | Pascal and I discussed this and we think it's generally better to take a 'RopeSlice' rather than a '&Rope'. The code block rendering function in the markdown component module is a good example for how this can be useful: we can remove an allocation of a rope and instead directly turn a '&str' into a 'RopeSlice' which is very cheap. A change to prefer 'RopeSlice' to '&Rope' whenever the rope isn't modified would be nice, but it would be a very large diff (around 500+ 500-). Starting off with just the syntax functions seems like a nice middle-ground, and we can remove a Rope allocation because of it. Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>
* Tune regex highlights for usage in promptsMichael Davis2023-07-27
| | | | | | | | | | | Since regex is almost always injected into other languages, `pattern_character`s will inherit the highlight for the structure that injects them (for example `/foo/` in JavaScript or `~r/foo/` in Elixir). This removes the string highlight when used in the prompt. We also add `ERROR` node highlighting so that errors in regex syntax appear in the prompt. This resolves a TODO in the `regex_prompt` function about highlighting errors in the regex.
* Syntax-highlight regex promptsMichael Davis2023-07-27
| | | | | | | | | | | We can use tree-sitter-regex highlighting in prompts for entering regexes, like `search` or `global_search`. The `highlighted_code_block` function from the markdown component makes this a very small change. This could be improved in the future by leaving the parsed syntax tree on the prompt, allowing incremental updates. Prompt lines are usually so short though and tree-sitter-regex is rather small and uncomplicated, so that improvement probably wouldn't make a big difference.
* Save an undo checkpoint before accepting completion (#7747)Michael Davis2023-07-27
|
* Add support for LSP DidChangeWatchedFiles (#7665)Ryan Fowler2023-07-21
| | | | | | | | | | | | | | | | | | | * Add initial support for LSP DidChangeWatchedFiles * Move file event Handler to helix-lsp * Simplify file event handling * Refactor file event handling * Block on future within LSP file event handler * Fully qualify uses of the file_event::Handler type * Rename ops field to options * Revert newline removal from helix-view/Cargo.toml * Ensure file event Handler is cleaned up when lsp client is shutdown
* feat: resolve code action (#7677)sigmaSd2023-07-21
|
* Clear statusline while prompt is visible (#7646)Pascal Kuthe2023-07-17
|
* enhanced `surround_replace` to provide visual feedback (#7588)Alex Vinyals2023-07-13
|
* Fix piping to Helix on macOS (#5468)Jonathan2023-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>
* Initialize log and config files right after parsing arguments (#7585)Alex Vinyals2023-07-09
|
* Implement the wa! command (#7577)Ryan Fowler2023-07-09
|
* Fix `:log-open` when `--log` is specified (#7573)Alex Vinyals2023-07-09
|
* Add filename completer for shell prompt (#7569)Alberto Romero2023-07-08
|
* use redraw handle for debouncing LSP messages (#7538)Pascal Kuthe2023-07-07
|
* LSP: Use negotiated position encoding for workspace edits (#7469)Michael Davis2023-06-29
| | | | Previously this was hard-coded to UTF-8 but we might have negotiated another position encoding.
* LSP: Discard publishDiagnostic from uninitialized servers (#7467)Michael Davis2023-06-28
| | | | | | | | | | | | | | The spec explicitly disallows publishDiagnostic to be sent before the initialize response: > ... the server is not allowed to send any requests or notifications to > the client until it has responded with an InitializeResult ... (https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initialize) But if a non-compliant server sends this we currently panic because we '.expect()' the server capabilities to be known to fetch the position encoding. Instead of panicking we can discard the notification and log the non-compliant behavior.
* make TS matching fallback to plaintextPascal Kuthe2023-06-22
|