aboutsummaryrefslogtreecommitdiff
path: root/helix-term
Commit message (Collapse)AuthorAge
* Make prompt suggestions greyed outJonathan LEI2022-12-17
|
* Better sorting in picker in case of ties (#5169)Alex Kladov2022-12-17
|
* Print the binary required by the debug adapter (#5195)Eric Thorburn2022-12-17
| | | | | | | | | | This commit addresses issue 5193, where the author requested that the name of the binary needed is printed along with the rest of the health information. This commit adds a format! macro which formats in the name of the binary and then it will be printed along with the rest of the debug information. The value in cmd is referenced to the call to which, and then consumed upon the call to format!
* Remove redraw to fix buildBlaž Hrastnik2022-12-15
|
* Restore deleted goto_pos function (#5164)Sebastian Zivota2022-12-15
|
* add redraw command (#4354)Roberto Vidal2022-12-15
| | | | | | | | | | | | | * add redraw command * update docs * Update helix-term/src/commands/typed.rs Co-authored-by: Michael Davis <mcarsondavis@gmail.com> * update docs Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Select diagnostic range in goto_*_diag commands (#4713)Michael Davis2022-12-15
| | | | | This roughly matches the behavior of the diagnostic picker: when jumping to a diagnostic with `[d`/`]d`/`[D`/`]D`, the range of the diagnostic is selected instead of the start point.
* workspace symbols: Default to empty Vec on NoneMichael Davis2022-12-15
| | | | | | | A language server might send None as the response to workspace symbols. We should treat this as the empty Vec rather than the server sending an error status. This fixes the interaction with gopls which uses None to mean no matching symbols.
* DynamicPicker: Reset idle timeout on refreshMichael Davis2022-12-15
| | | | | | | If the new results shown by the picker select a file that hasn't been previewed before, the idle timeout would not trigger highlighting on that file. With this change, we reset the idle timeout and allow that file to be highlighted on the next idle timeout event.
* DynamicPicker: Use idle-timeout as debounceMichael Davis2022-12-15
| | | | | | This change uses the idle-timeout event to trigger fetching new results in the DynamicPicker, so idle-timeout becomes a sort of debounce. This prevents querying the language server overly aggressively.
* Re-request workspace symbols on keypress in pickerGokul Soumya2022-12-15
| | | | | | | | | | | Most language servers limit the number of workspace symbols that are returned with an empty query even though all symbols are supposed to be returned, according to the spec (for perfomance reasons). This patch adds a workspace symbol picker based on a dynamic picker that allows re-requesting the symbols on every keypress (i.e. when the picker query text changes). The old behavior has been completely replaced, and I have only tested with rust-analyzer so far.
* Add DynamicPicker for updating options on every keyGokul Soumya2022-12-15
|
* Add force_score() for scoring picker items without optimizationsGokul Soumya2022-12-15
|
* Improve error message handling for theme loading failures (#5073)Michael Davis2022-12-15
| | | | | | | | | | | | | | | | | The error messages for a theme that failed to be deserialized (or otherwise failed to load) were covered up by the context/with_context calls: * The log message for a bad theme configured in config.toml would only say "Failed to deserilaize theme" * Selecting a bad theme via :theme would show "Theme does not exist" With these changes, we let the TOML deserializer errors bubble up, so the error messages can now say the line number of a duplicated key - and that key's name - when a theme fails to load because of a duplicated key. Providing a theme which does not exist to :theme still gives a helpful error message: "No such file or directory."
* Add `:pipe-to` typable command that ignores shell output (#4931)Alexander Schlögl2022-12-12
|
* Reset mode when changing buffers (#5072)Michael Davis2022-12-11
| | | | | | | | | | | | | | * Reset mode when changing buffers This is similar to the change in e4c9d4082a139aac3aea4506918171b96e81f5b9: reset the editor to normal mode when changing buffers. Usually the editor is already in normal mode but it's possible to setup insert-mode keybindings that change buffers. * Move normal mode entering code to Editor This should be called internally in the Editor when changing documents (Editor::switch) or changing focuses (Editor::focus).
* properly handle detachted git worktrees (#5097)Pascal Kuthe2022-12-11
|
* Fix LSP completions ignoring auto-completion option (#5042)Jummit2022-12-09
|
* feat(lsp): pass client_info on initialization (#4904)Matouš Dzivjak2022-12-09
| | | | Pass client name ('helix') and client version (version / git hash) to LSP server on initialization.
* Only write newlines in menu selection popup if the lsp returns detail (#4902)ath32022-12-09
|
* Add command/keybinding to jump between hunks (#4650)Pascal Kuthe2022-12-06
| | | | | | | | | | | | | | | * add command and keybding to jump to next/prev hunk * add textobject for change * Update helix-vcs/src/diff.rs Co-authored-by: Michael Davis <mcarsondavis@gmail.com> * select entire hunk instead of first char * fix selection range Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* fix: align view after jumplist_picker (#3743)Narazaki Shuji2022-12-06
| | | | | | | | | * Add `View::ensure_cursor_in_view_center` to adjust view after searching and jumping Also `offset_coodrs_to_in_view` was refactored to reduce duplicated position calculations. * Fix a wrong offset calculation in `offset_coords_to_in_view_center` It ignored `scrolloff` if `centering` is false.
* Apply completion edits to all cursors (#4496)Michael Davis2022-12-06
| | | | | | | | Completion edits - either basic `insert_text` strings or structured `text_edit`s - are assumed by the LSP spec to apply to the current cursor (or at least the trigger point). We can use the range (if any) and text given by the Language Server to create a transaction that changes all ranges in the current selection though, allowing auto- complete to affect multiple cursors.
* Change default TS object bindings (#3782)nosa2022-12-06
| | | | | | | | | | | | | | * Change default TS object bindings Changes 'match inside/around' bindings for: - type definition from `c` to `t` - comments from `o` to `c` - tests from `t` to `T` Also changes those for the `]` / `[` bindings. * Update docs for changed keybinds Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Fix transaction composition order in History::changes_since (#4981)Michael Davis2022-12-03
| | | | | | | | | | | * Add a undo/redo split test case for crossing branches * history: Switch up/down transaction chaining order The old code tends to work in practice because, usually, either up_txns or down_txns are empty. When both have contents though, we can run into a panic trying to compose them all since they will disagree on the length of the text. This fixes the panic test case in the parent commit.
* Add Ctrl-i alias for Windows (#4961)lesleyrs2022-12-02
|
* feat(lsp): add support for lsp Diagnostic{}.data (#4935)sigmaSd2022-12-02
|
* reload_all: Ensure view is synced with doc history before reload (#4965)Michael Davis2022-12-02
|
* Fix nightly clippy lints (#4954)Tshepang Mbambo2022-12-01
|
* Show (git) diff signs in gutter (#3890)Pascal Kuthe2022-12-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Show (git) diff signs in gutter (#3890) Avoid string allocation when git diffing Incrementally diff using changesets refactor diffs to be provider indepndent and improve git implementation remove dependency on zlib-ng switch to asynchronus diffing with similar Update helix-vcs/Cargo.toml fix toml formatting Co-authored-by: Ivan Tham <pickfire@riseup.net> fix typo in documentation use ropey reexpors from helix-core fix crash when creating new file remove useless use if io::Cursor fix spelling mistakes implement suggested improvement to repository loading improve git test isolation remove lefover comments Co-authored-by: univerz <univerz@fu-solution.com> fixed spelling mistake minor cosmetic changes fix: set self.differ to None if decoding the diff_base fails fixup formatting Co-authored-by: Ivan Tham <pickfire@riseup.net> reload diff_base when file is reloaded from disk switch to imara-diff Fixup formatting Co-authored-by: Blaž Hrastnik <blaz@mxxn.io> Redraw buffer whenever a diff is updated. Only store hunks instead of changes for individual lines to easily allow jumping between them Update to latest gitoxide version Change default diff gutter position Only update gutter after timeout * update diff gutter synchronously, with a timeout * Apply suggestions from code review Co-authored-by: Blaž Hrastnik <blaz@mxxn.io> Co-authored-by: Michael Davis <mcarsondavis@gmail.com> * address review comments and ensure lock is always aquired * remove configuration for redraw timeout Co-authored-by: Blaž Hrastnik <blaz@mxxn.io> Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Add a test case for undo/redo across splitsMichael Davis2022-11-29
|
* Call View::apply within Document::append_changes_to_historyMichael Davis2022-11-29
|
* Revert "Don't apply transactions to Views in undo/redo"Michael Davis2022-11-29
| | | | This reverts commit fd00f3a70eb626242bb2fcc9bddf2c4d94580a9a.
* Remove eager application of transactions to all viewsMichael Davis2022-11-29
|
* reload-all: Only update viewport when view focuses on the doc (#4901)Filipe Azevedo2022-11-26
|
* Clear line on `<ret>` when line is all whitespace (#4854)Michael Davis2022-11-25
| | | | | | This matches the insert-mode behavior for Vim and Kakoune: if the current line is empty except for whitespace, `<ret>` should insert a line ending at the beginning of the line, moving any indentation to the next line.
* Exit select mode on surround commands (#4858)Jonathan LEI2022-11-24
|
* Follow parent links when calculating changes since a revisionMichael Davis2022-11-24
| | | | | | The 'revisions' field on History can't be treated as linear: each Revision in the revisions Vec has a parent link and an optional child link. We can follow those to unroll the recent history.
* Apply inversions to Views on undo/redoMichael Davis2022-11-24
| | | | | | | | When using undo/redo, the history revision can be decremented. In that case we should apply the inversions since the given revision in History::changes_since. This prevents panics with jumplist operations when a session uses undo/redo to move the jumplist selection outside of the document.
* Don't apply transactions to Views in undo/redoMichael Davis2022-11-24
| | | | | | View::apply should only be called by EditorView after 42e37a571e75aaf4feb1717dfebe8cf215e535dd. This change removes the duplicate calls within undo/redo which could cause a panic.
* Add test case that panics on undoMichael Davis2022-11-24
| | | | | | | This case panics since undo/redo call View::apply and here, the edit that moves the jumplist selection out-of-bounds is not yet applied when View::apply is called in undo/redo. View::apply should only be called by the EditorView now.
* Apply transactions to all views (#4733)Michael Davis2022-11-23
| | | | | | | | | | | | | | | | | * Add a test case for updating jumplists across windows * Apply transactions to all views on history changes This ensures that jumplist selections follow changes in documents, even when there are multiple views (for example a split where both windows edit the same document). * Leave TODOs for cleaning up View::apply * Use Iterator::reduce to compose history transactions Co-authored-by: Blaž Hrastnik <blaz@mxxn.io> Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
* lsp: Check server provider capabilities (#3554)Michael Davis2022-11-22
| | | | | | | | | | | | | | Language Servers may signal that they do not support a method in the initialization result (server capabilities). We can check these when making LSP requests and hint in the status line when a method is not supported by the server. This can also prevent crashes in servers which assume that clients do not send requests for methods which are disabled in the server capabilities. There is an existing pattern the LSP client module where a method returns `Option<impl Future<Output = Result<_>>>` with `None` signaling no support in the server. This change extends this pattern to the rest of the client functions. And we log an error to the statusline for manually triggered LSP calls which return `None`.
* remove duplicated shell calls (#3465)Bob2022-11-22
|
* Limit the number of items in the jumplist (#4750)Michael Davis2022-11-22
| | | | | | | | | | | | | | | | | | | | | Previously, jumplists could grow unchecked. Every transaction is applied to jumplist selections to ensure that they are up to date and within document bounds, so this would cause every edit to become more expensive as jumplist lengths increased throughout a session. Setting a maximum number of entries limits the cost. Vim and Neovim limit their jumplists: * https://github.com/vim/vim/blob/b298fe6cbae3b240b10dbd55d9c38d0cc8e033d3/src/structs.h#L141 * https://github.com/neovim/neovim/blob/e8cc489accc435076afb4fdf89778b64f0a48473/src/nvim/mark_defs.h#L57 Notably, Kakoune does not. In Kakoune, changes are applied to jumplist entries lazily as you hit `<C-o>`/`<C-i>` though, so Kakoune doesn't have the same growing cost concerns. Kakoune also does not have a concept of a View which limits the cost further. Vim and Neovim limit to 100. This seems unreasonably high to me so I've set this to 30 to start. We can increase if this is problematically low.
* Select new pasted text in normal mode only (#4824)Michael Davis2022-11-21
| | | | | | | | | | | | | | | | | | d6323b7cbc21a9d3ba29738c76581dad93f9f415 changed the behavior of paste to select the newly inserted text. This is preferrable in normal mode because it's useful to be able to act on the new text. This behavior is worse for insert or select mode though: * In insert mode, the cursor ends up on the last character of the newly selected text, so further typing inserts text before the last character. * In select mode, the current selection is replaced with the new text selection which doesn't extend the current selection. With this change, the selection is extended to include the new text. This aligns the behavior more closely with Kakoune, but it's coincidental instead of intentional: Kakoune doesn't implement bracketed paste (AFAIK) which causes this behavior in insert mode, and Kakoune doesn't have a select mode.
* Add preview for scratch buffers in buffer picker (#3454)A-Walrus2022-11-21
|
* Add `:reload-all` command (#4663)Filipe Azevedo2022-11-20
|
* Make `r<tab>` and `f<tab>` work (#4817)Lennard Hofmann2022-11-19
| | | | | Previously, commands such as `r<tab>` (replace with tab) or `t<tab>` (select till tab) had no effect. This is because `KeyCode::Tab` needs special treatment (like `KeyCode::Enter`).
* minor: render_diagnostics doesn't require &self eitherBlaž Hrastnik2022-11-19
|