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.
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.
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.
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."
* 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).
* 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>
* 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.
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
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>