`extend_line_above` (and `extend_line` when facing backwards) skip
a line when the current range does not fully cover a line.
Before this change:
foo
b#[|a]#r
baz
With `extend_line_above` or `extend_line` selected the line above.
#[|foo
bar]#
baz
Which is inconsistent with `extend_line_below`. This commit changes
the behavior to select the current line when it is not already
selected.
foo
#[|bar]#
baz
Then further calls of `extend_line_above` extend the selection up
line-wise.
Currently it is not possible to save a file with a language that
has an external formatter configuration unless the external
formatter is installed, even if the language has a Language Server
configuration capable of auto-format. This change checks that the
external formatter exists before using it to create a formatting
callback.
* fix: Recalculate completion when going through prompt history
* Update completion when the prompt line is changed
It should not be possible to update the line without also updating the
completion since the completion holds an index into the line.
* Fix Prompt::with_line recalculate completion
with_line was the last function where recalculate completion had to be
done manually. This function now also recalculates the completion so
that it's impossible to forget.
* Exit selection when recalculating completion
Keeping the selection index when the completion has been recalculated
doesn't make sense. This clears the selection automatically, removing
most needs to manually clear it.
* Remove &mut on save_filter
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
It was starting to diverge as the normal exit code was restoring the prompt but the panic code
wasn't, and the panic code was disabling bracketed paste but the normal code wasn't.
This changes the panic path slightly in that we won't disable raw mode if exiting alternate screen
and disabling bracketed paste fails. If that happens, things are so busted I don't think it matters
anyway.
Fixes a panic with a config like:
[keys.normal.space]
x = [":buffer-close"]
by bailing out of the command-execution handling if the document
doesn't exist after handling a command.
This refactor changes the overall structure of the goto_ts_object_impl
command without removing any functionality from its behavior. The
refactored motion:
* acts on all selections instead of reducing to one selection
* may be repeated with the `repeat_last_motion` (A-.) command
* informs the user when the syntax-tree is not accessible in the current buffer
This is invalid according to the [LSP spec]:
> In addition the server is not allowed to send any requests
> or notifications to the client until it has responded with an
> InitializeResult, with the exception that during the initialize
> request the server is allowed to send the notifications
> window/showMessage, window/logMessage and telemetry/event as well
> as the window/showMessageRequest request to the client.
So we should discard the message when the language server is not
yet initialized. This can happen if the server sends
textDocument/publishDiagnostics before responding to the initialize
request. clojure-lsp appears to exhibit this behavior in the wild.
[LSP Spec]: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initialize
There don't appear to be any regressions from the updates.
Also included is a fix which highlights the "#" as in attributes
as punctuation. This was previously unhighlighted.
For example
-record(state, {})
Would not highlight `state` as a type since the alternation didn't
allow for an empty tuple. Allowing the inner atom of the tuple to be
optional fixes this case.
This change adds documents to the view's document history Vec.
(This is used by `ga` for example to access the last buffer.)
Previously, a sequence like so would have confusing behavior:
1. Open file A: any document with an active language server
2. Find some definition that lives in another file - file B - with `gd`
3. Jump back in the jumplist with `C-o` to file A
4. Use `ga` intending to switch back to file B
The behavior prior to this change was that `ga` would switch to file
A: you could not use `ga` to switch to file B.