Commit graph

1929 commits

Author SHA1 Message Date
greg-enbala
60f84be40c
Separate jump behavior from increment/decrement (#4123)
increment/decrement (C-a/C-x) had some buggy behavior where selections
could be offset incorrectly or the editor could panic with some edits
that changed the number of characters in a number or date. These stemmed
from the automatic jumping behavior which attempted to find the next
date or integer to increment. The jumping behavior also complicated the
code quite a bit and made the behavior somewhat difficult to predict
when using many cursors.

This change removes the automatic jumping behavior and only increments
or decrements when the full text in a range of a selection is a number
or date. This simplifies the code and fixes the panics and buggy
behaviors from changing the number of characters.
2023-01-16 10:15:23 -06:00
Itay123
d3e0f18c89
Added opening files in the background with A-ret shortcut (#4435) 2023-01-16 16:18:13 +09:00
Pascal Sommer
75dfaff338
Add some function documentations (#5360) 2023-01-10 20:11:43 -06:00
Dylan Bulfin
c4b0eb8356
Fix autocompletion for paths with period (#5175)
* Bug fix

Updated bug fix

* Simplified conditionals

* Switched to use path separator constant
2023-01-09 11:25:19 +09:00
Lorenzo Albano
b7ca0581d8
Store new config on application in :config-reload (#5431)
After changes in #5239, the loaded configuration wasn't stored,
resulting in a success message even if the instance kept the previous
configuration values.
2023-01-08 09:30:38 -06:00
Ethan Kiang
0dbee9590b
Fix language config reload logic (#5381) 2023-01-03 07:24:48 -06:00
dependabot[bot]
a895a4e53a
build(deps): bump arc-swap from 1.5.1 to 1.6.0 (#5375)
Bumps [arc-swap](https://github.com/vorner/arc-swap) from 1.5.1 to 1.6.0.
- [Release notes](https://github.com/vorner/arc-swap/releases)
- [Changelog](https://github.com/vorner/arc-swap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vorner/arc-swap/compare/v1.5.1...v1.6.0)

---
updated-dependencies:
- dependency-name: arc-swap
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-02 21:29:23 -06:00
dependabot[bot]
d6d6267378
build(deps): bump once_cell from 1.16.0 to 1.17.0 (#5373)
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.16.0 to 1.17.0.
- [Release notes](https://github.com/matklad/once_cell/releases)
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.16.0...v1.17.0)

---
updated-dependencies:
- dependency-name: once_cell
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-02 21:07:25 -06:00
Gabriel Dinner-David
1b1755240d
fix(commands): extend_line to proper line when count and current line selected (#5288) 2022-12-31 08:23:55 -06:00
Nick
c9ed42cdec
Add a status line element that shows just the basename of the file (#5318) 2022-12-31 08:18:14 -06:00
iobtl
6c95411488
Expand ~ when parsing file paths in :open (#5329) 2022-12-29 10:13:06 -06:00
willful759
9d15b85209
Reload language config with :config-reload (#5239) 2022-12-29 09:51:23 -06:00
Triton171
5f2fe5fca5
Fix erroneous indent between closers of auto-pairs (#5330)
inserting a newline between 2 closers of an auto-pair.
2022-12-29 09:23:40 -06:00
alois31
eb4ec32710
Fix opening new files (#5278)
Commit 1b89d3e535 introduced a regression
where opening a new file would no longer work, because attempting to
canonicalize its path would lead to a "No such file or directory"
error. Fall back to opening a new file when encountering an error to
fix this case.
2022-12-24 07:50:39 -06:00
Nick
24c3b00d10
Avoid trailing s in message when only 1 file is opened (#5189) 2022-12-23 08:13:05 -06:00
jliaoh
df1830ef28
mouse operations respect scrolloff (#5255) 2022-12-22 20:30:33 -06:00
DylanBulfin
1107296ca9
Add command to merge consecutive ranges in selection (#5047) 2022-12-22 20:27:20 -06:00
Jack Allison
1b89d3e535
Add file picker dialogue when opening a directory with :o (#2707) 2022-12-22 20:23:34 -06:00
dependabot[bot]
38fd20c858
build(deps): bump indoc from 1.0.7 to 1.0.8 (#5226)
Bumps [indoc](https://github.com/dtolnay/indoc) from 1.0.7 to 1.0.8.
- [Release notes](https://github.com/dtolnay/indoc/releases)
- [Commits](https://github.com/dtolnay/indoc/compare/1.0.7...1.0.8)

---
updated-dependencies:
- dependency-name: indoc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-19 17:22:27 -06:00
Jonathan LEI
24cd7f6adf Make prompt suggestions greyed out 2022-12-17 13:59:05 -06:00
Alex Kladov
e6a2df8c79
Better sorting in picker in case of ties (#5169) 2022-12-17 13:30:43 -06:00
Eric Thorburn
b12c65678a
Print the binary required by the debug adapter (#5195)
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!
2022-12-17 13:03:18 -06:00
Blaž Hrastnik
ec9aa66902
Remove redraw to fix build 2022-12-15 22:23:06 +09:00
Sebastian Zivota
5c4a9cba9a
Restore deleted goto_pos function (#5164) 2022-12-15 22:20:26 +09:00
Roberto Vidal
f916915b53
add redraw command (#4354)
* 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>
2022-12-15 17:59:34 +09:00
Michael Davis
42ad1a9e04
Select diagnostic range in goto_*_diag commands (#4713)
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.
2022-12-15 17:57:31 +09:00
Michael Davis
2a60de74f9 workspace symbols: Default to empty Vec on None
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.
2022-12-15 17:52:44 +09:00
Michael Davis
35cf972ce4 DynamicPicker: Reset idle timeout on refresh
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.
2022-12-15 17:52:44 +09:00
Michael Davis
a7daa02346 DynamicPicker: Use idle-timeout as debounce
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.
2022-12-15 17:52:44 +09:00
Gokul Soumya
d1f717eb8d Re-request workspace symbols on keypress in picker
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.
2022-12-15 17:52:44 +09:00
Gokul Soumya
914d294499 Add DynamicPicker for updating options on every key 2022-12-15 17:52:44 +09:00
Gokul Soumya
c64debc741 Add force_score() for scoring picker items without optimizations 2022-12-15 17:52:44 +09:00
Michael Davis
db939801eb
Improve error message handling for theme loading failures (#5073)
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."
2022-12-15 17:49:49 +09:00
Alexander Schlögl
0b96021643
Add :pipe-to typable command that ignores shell output (#4931) 2022-12-11 20:06:24 -06:00
Michael Davis
cdc54f50a2
Reset mode when changing buffers (#5072)
* Reset mode when changing buffers

This is similar to the change in
e4c9d4082a: 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).
2022-12-12 00:04:08 +09:00
Pascal Kuthe
70d78123b9
properly handle detachted git worktrees (#5097) 2022-12-11 19:20:34 +09:00
Jummit
2ea20a23e2
Fix LSP completions ignoring auto-completion option (#5042) 2022-12-08 22:02:34 -06:00
Matouš Dzivjak
8abed3bd78
feat(lsp): pass client_info on initialization (#4904)
Pass client name ('helix') and client version (version / git hash)
to LSP server on initialization.
2022-12-08 21:57:03 -06:00
ath3
6798a6651f
Only write newlines in menu selection popup if the lsp returns detail (#4902) 2022-12-08 21:55:15 -06:00
Pascal Kuthe
af532147c9
Add command/keybinding to jump between hunks (#4650)
* 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>
2022-12-06 23:18:33 +09:00
Narazaki Shuji
453a75a373
fix: align view after jumplist_picker (#3743)
* 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.
2022-12-06 11:16:08 +09:00
Michael Davis
2077f5e26a
Apply completion edits to all cursors (#4496)
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.
2022-12-06 10:29:40 +09:00
nosa
7210c58a51
Change default TS object bindings (#3782)
* 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>
2022-12-06 10:13:41 +09:00
Michael Davis
bcdb475b71
Fix transaction composition order in History::changes_since (#4981)
* 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.
2022-12-03 12:09:08 +09:00
lesleyrs
39ce82b7a5
Add Ctrl-i alias for Windows (#4961) 2022-12-02 08:02:29 -06:00
sigmaSd
4960c41f18
feat(lsp): add support for lsp Diagnostic{}.data (#4935) 2022-12-02 10:18:45 +09:00
Michael Davis
8291654326
reload_all: Ensure view is synced with doc history before reload (#4965) 2022-12-02 10:18:32 +09:00
Tshepang Mbambo
a8a54be6bc
Fix nightly clippy lints (#4954) 2022-12-01 10:37:38 -06:00
Pascal Kuthe
5a3ff74221
Show (git) diff signs in gutter (#3890)
* 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>
2022-12-01 17:35:23 +09:00
Michael Davis
4802f26a23 Add a test case for undo/redo across splits 2022-11-30 01:15:20 +09:00
Michael Davis
9a9e462183 Call View::apply within Document::append_changes_to_history 2022-11-30 01:15:20 +09:00
Michael Davis
4d1f5389f9 Revert "Don't apply transactions to Views in undo/redo"
This reverts commit fd00f3a70e.
2022-11-30 01:15:20 +09:00
Michael Davis
df5457a6e7 Remove eager application of transactions to all views 2022-11-30 01:15:20 +09:00
Filipe Azevedo
f0f295a667
reload-all: Only update viewport when view focuses on the doc (#4901) 2022-11-26 14:40:43 -06:00
Michael Davis
2271c3aed9
Clear line on <ret> when line is all whitespace (#4854)
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.
2022-11-25 11:40:48 +09:00
Jonathan LEI
1d21683321
Exit select mode on surround commands (#4858) 2022-11-24 11:07:19 +09:00
Michael Davis
a3f321a531 Follow parent links when calculating changes since a revision
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.
2022-11-24 10:57:12 +09:00
Michael Davis
4a103db622 Apply inversions to Views on undo/redo
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.
2022-11-24 10:57:12 +09:00
Michael Davis
fd00f3a70e Don't apply transactions to Views in undo/redo
View::apply should only be called by EditorView after
42e37a571e. This change removes the
duplicate calls within undo/redo which could cause a panic.
2022-11-24 10:57:12 +09:00
Michael Davis
94eb3de776 Add test case that panics on undo
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.
2022-11-24 10:57:12 +09:00
Michael Davis
42e37a571e
Apply transactions to all views (#4733)
* 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>
2022-11-23 12:28:49 +09:00
Michael Davis
9059c65a53
lsp: Check server provider capabilities (#3554)
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`.
2022-11-22 11:52:23 +09:00
Bob
1db01caec7
remove duplicated shell calls (#3465) 2022-11-22 10:55:46 +09:00
Michael Davis
8102c3224f
Limit the number of items in the jumplist (#4750)
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:

* b298fe6cba/src/structs.h (L141)
* e8cc489acc/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.
2022-11-22 10:54:50 +09:00
Michael Davis
bbde897ac3
Select new pasted text in normal mode only (#4824)
d6323b7cbc 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.
2022-11-21 11:49:44 +09:00
A-Walrus
2f9ca3840a
Add preview for scratch buffers in buffer picker (#3454) 2022-11-20 19:58:35 -06:00
Filipe Azevedo
8dac863a5b
Add :reload-all command (#4663) 2022-11-20 12:39:26 -06:00
Lennard Hofmann
0e23e4f882
Make r<tab> and f<tab> work (#4817)
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`).
2022-11-19 11:08:03 -06:00
Blaž Hrastnik
7e99087fa3
minor: render_diagnostics doesn't require &self either 2022-11-19 15:41:55 +09:00
Blaž Hrastnik
a640ab6b1f
Avoid repeatedly loading config 2022-11-19 15:41:03 +09:00
Michael Davis
8be2d1dcbf
Handle language server termination (#4797)
This change handles a language server exiting. This was a UX sore-spot:
if a language server crashed, Helix did not recognize the exit and
continued to send requests to it. All requests would timeout since they
would not receive responses. This would also hold-up Helix closing
itself down since it would try to gracefully shutdown the server which
is implemented in the LSP spec as a request.

We could attempt to automatically restart the language server on crash.
I left this for future work since that change will need to be slightly
complicated: it will need to cover the case of a language server
repeatedly crashing.
2022-11-19 13:14:36 +09:00
Michael Davis
89efb4f711
lsp: Resolve completion item asynchronously on idle-timeout (#4781)
d7d0d5ffb7 resolves completion items on
the idle-timeout event. The `Completion::resolve_completion_item`
function blocks on the LSP request though, which blocks the compositor
and in turn blocks the event loop. So until the language server returns
the resolved completion item, Helix is unable to respond to keypresses
or other LSP messages.

This is typically ok since the resolution request is fast but for some
language servers this can be problematic, and ideally we shouldn't be
blocking like this anyways.

When receiving a `completionItem/resolve` request, the Volar server
sends a `workspace/configuration` request to Helix and blocks itself
on the response, leading to a deadlock. Eventually the resolve request
times out within Helix but Helix is locked up and unresponsive in that
window.

This change resolves the completion item without blocking the
compositor.
2022-11-19 03:27:46 +09:00
Austen Adler
1569d2000b
Select surrounding characters when using match/surround (m) mode (#4752)
Co-authored-by: Austen Adler <agadler@austenadler.com>
2022-11-17 20:46:03 -06:00
ChrHorn
322e957ea1
Remove prefix filtering from autocomplete menu (#4578)
PR #4134 switched the autocomplete menu from alphabetical to fuzzy
sorting. This commit removes the still existing filtering by prefix and
should enable full fuzzy sorting of the autocomplete menu.

closes #3084, #1807

Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
2022-11-17 10:16:03 +09:00
Michael Davis
c6b83368b3
Capture word parts while calculating shellwords (#4632)
This fixes an edge case for completing shellwords. With a file
"a b.txt" in the current directory, the sequence `:open a\<tab>`
will result in the prompt containing `:open aa\ b.txt`. This is
because the length of the input which is trimmed when replacing with
completion is calculated on the part of the input which is parsed by
shellwords and then escaped (in a separate operation), which is lossy.
In this case it loses the trailing backslash.

The fix provided here refactors shellwords to track both the _words_
(shellwords with quotes and escapes resolved) and the _parts_ (chunks
of the input which turned into each word, with separating whitespace
removed). When calculating how much of the input to delete when
replacing with the completion item, we now use the length of the last
part.

This also allows us to eliminate the duplicate work done in the
`ends_with_whitespace` check.
2022-11-17 10:00:48 +09:00
Michael Davis
6eec14ee37
Use key-sequence format for command palette keybinds (#4712)
The text within the command palette used a custom format to display
the keybinding for a command. This change switches to the key sequence
format that we use for pending keys and macros.
2022-11-17 09:58:54 +09:00
Pascal Kuthe
4b89177e53
sort fuzzy matches with equal score by length in picker (#4698) 2022-11-16 17:28:20 -06:00
Blaž Hrastnik
fe11ae2218
minor: Simplify some command code 2022-11-16 18:14:30 +09:00
Blaž Hrastnik
a3173c2280
minor: cloning filter and using count() is wasteful here 2022-11-16 18:14:30 +09:00
Blaž Hrastnik
df6d04425d
fix build 2022-11-15 23:34:00 +09:00
Armin Ronacher
392a018aeb
Add command to add word boundaries to search (#4322)
* Add command to add word boundaries to search

* Calculate string capacity before building
2022-11-15 23:16:27 +09:00
Manos Mertzianis
77be98c783
Popup scrollbar (#4449)
* init

* cargo fmt

* optimisation of the scrollbar render both for Menu and Popup. Toggling off scrollbar for Popup<Menu>, since Menu has its own

* rendering scroll track

* removed unnecessary cast

* improve memory allocation

* small correction
2022-11-15 23:15:52 +09:00
ath3
3b7760dfb0
Refactor blackhole register (#4504) 2022-11-15 23:14:18 +09:00
Gaurav Tyagi
91ff903bf3
Add global error/warning count statusline element (#4569) 2022-11-14 19:46:07 -06:00
Michael Davis
c74b97447f
Fix range offsets for multiple shell insertions (#4619)
d6323b7cbc introduced a regression for
shell commands like `|`, `!`, and `<A-!>` which caused the new
selections to be incorrect. This caused a panic when piping (`|`)
would cause the new range to extend past the document end.

The paste version of this bug was fixed in
48a3965ab4.

This change also inherits the direction of the new range from the old
range and adds integration tests to ensure that the behavior isn't
broken in the future.
2022-11-14 09:45:52 +09:00
wes adams
fd585c1ee4
Statusline indicator to show number of selected chars (#4682)
Co-authored-by: wes adams <wadams@grayshift.com>
2022-11-12 11:31:09 -06:00
asvln
1f72d34249 rename description for goto_line_end_newline 2022-11-11 19:14:08 -06:00
asvln
7468fa28fd add extend_prev_word_end command 2022-11-11 19:14:08 -06:00
Bruce Hopkins
bc0a3037ea
feat(commands): increment by range (#4418) 2022-11-11 13:50:25 -05:00
Blaž Hrastnik
758bace221
fix test compilation 2022-11-09 22:17:14 +09:00
Blaž Hrastnik
264a455c18
Move terminal out of compositor 2022-11-09 22:10:49 +09:00
Blaž Hrastnik
00d7b18097
This term specific behavior really doesn't belong to compositor 2022-11-09 21:47:46 +09:00
Blaž Hrastnik
b2e7171fed
Drop terminal interaction in compositor.size() 2022-11-09 21:37:56 +09:00
Blaž Hrastnik
d4f5cab7b5
Re-enable format_selections for a single selection range 2022-11-09 18:17:23 +09:00
Matthias Deiml
dee5b2a983
Add LSP workspace command picker (#3140)
* Add workspace command picker

* Make command typable

* Add optional argument to lsp-workspace-command
2022-11-09 18:17:09 +09:00
Marko Klobučar Ledinšćak
d8e9c85f5e
error! on unknown CompletionItemKind (#4658) 2022-11-08 12:36:01 -06:00
Doug Kelkhoff
7ed9e9cf25
Dynamically resize line number gutter width (#3469)
* dynamically resize line number gutter width

* removing digits lower-bound, permitting spacer

* removing max line num char limit; adding notes; qualified successors; notes

* updating tests to use new line number width when testing views

* linenr width based on document line count

* using min width of 2 so line numbers relative is useful

* lint rolling; removing unnecessary type parameter lifetime

* merge change resolution

* reformat code

* rename row_styler to style; add int_log resource

* adding spacer to gutters default; updating book config entry

* adding view.inner_height(), swap for loop for iterator

* reverting change of current! to view! now that doc is not needed
2022-11-08 21:19:59 +09:00
Blaž Hrastnik
c94feed83d
core: Move state into the history module 2022-11-08 21:03:54 +09:00
Blaž Hrastnik
13126823f8
lsp: Support insertReplace
Fixes #4473
2022-11-08 20:50:49 +09:00
Michael Davis
140df92d79 Fix command-mode completion behavior when input is escaped
If `a\ b.txt` were a local file, `:o a\ <tab>` would fill the prompt
with `:o aa\ b.txt` because the replacement range was calculated using
the shellwords-parsed part. Escaping the part before calculating its
length fixes this edge-case.
2022-11-07 13:38:16 +09:00