Commit graph

2212 commits

Author SHA1 Message Date
Marty
c39cde8fc2
Flush pending writes before suspend (#10797)
* flush saves before suspending

* review suggestion

Co-authored-by: Kirawi <67773714+kirawi@users.noreply.github.com>

* review changes

---------

Co-authored-by: PotatoesFall <martyk@tuta.io>
Co-authored-by: Kirawi <67773714+kirawi@users.noreply.github.com>
2024-06-05 18:47:15 +02:00
Poliorcetics
972265640d
fix: correctly reset inlay hints when stopping or restarting LSPs for a document (#10741) 2024-06-02 10:39:48 -05:00
Mark Stosberg
730e684d1d
Correct typo in "current buffer's directory" (#10814) 2024-05-27 10:22:40 +09:00
Blaž Hrastnik
dfcd814389 tui: Constify functions, shrink Margin representation 2024-05-21 04:34:36 +09:00
Michael Davis
ff6aca12b7
Reset all changes overlapped by selections in ':reset-diff-change' (#10178)
This is useful for resetting multiple changes at once. For example you
might use 'maf' or even '%' to select a larger region and reset all
changes within.

The original behavior of resetting the change on the current line is
retained when the primary selection is 1-width since we look for chunks
in the line range of each selection.
2024-05-20 21:40:55 +09:00
Michael Davis
5c11af1479 cargo fmt 2024-05-07 15:15:52 -04:00
Michael Davis
9dd51e75e0 Resolve new Clippy lints 2024-05-07 15:15:52 -04:00
Szabin
beb5afcbef
Revert "Refactor statusline elements to build Spans (#9122)" (#10642) 2024-05-07 01:51:20 +09:00
François Laignel
f86f350d5d
Debugger template: allow missing or empty completion list (#10332)
It can be convenient to define project specific debugger templates, some of
which might not necessitate prompting the user to define completion.

This commit makes completion optional for debugger templates and starts the
dap immediately if undefined or empty.
2024-05-06 17:37:04 +02:00
Hichem
cfca30887c
signature: use the suggested LSP signature when changed (#10655)
some LSPs does update the active signature and some not. To make both
worlds happy, make the active signature more intelligent.

1. SignatureHelp store now the suggested lsp_signature
2. if the lsp_signature changes then use it
3. otherwise use the last signature from the old popup
4. in case the old signature doesn't exist anymore, show the last signature

Signed-off-by: Ben Fekih, Hichem <hichem.f@live.de>
2024-05-03 03:53:07 +02:00
Kitsu
ec224798e7
fix: do not stop at first url at goto_file (#10622) 2024-04-29 08:18:58 -05:00
Pascal Kuthe
e2594b64c0 move popup when cursor line changes
Co-authored-by: Ben Fekih, Hichem" <hichem.f@live.de>
2024-04-28 11:21:50 -04:00
Pascal Kuthe
93e8c16614 fix required_size implementation of signature help
Trunctation should always be handled by the parent. Returning None is
only supposed to indicate a missing implementation

Co-authored-by: Ben Fekih, Hichem" <hichem.f@live.de>
2024-04-28 11:21:50 -04:00
Pascal Kuthe
2d6d876a23 fix popup size calculation
Co-authored-by: ath3 <ha05190@protonmail.com>
2024-04-28 11:21:50 -04:00
woojiq
81dc8e8d6b feat: find closest pair using tree-sitter 2024-04-24 16:36:13 -04:00
Pascal Kuthe
38ee845b05 don't overload LS with completion resolve requests
While moving completion resolve to the event system in #9668 we introduced what
is essentially a "DOS attack" on slow LSPs. Completion resolve requests were
made in the render loop and debounced with a timeout. Once the timeout expired
the resolve request was made. The problem is the next frame would immediately
request a new completion resolve request (and mark the old one as obsolete but
because LSP has no notion of cancelation the server would still process it). So
we were in essence sending one completion request to the server every 150ms and
only stopped if the server managed to respond before we rendered a new frame.
This caused overload on slower machines/with slower LS.

In this PR I revamped the resolve handler so that a request is only ever
resolved once. Both by checking if a request is already in-flight and by marking
failed resolve requests as resolved.
2024-04-22 12:27:47 +09:00
Pascal Kuthe
b834806dbc use newtype parttern for langauge server id 2024-04-22 12:27:47 +09:00
Simran Kedia
26d9610e78
Ignore .svn version control files (#10536)
Co-authored-by: Simran Kedia <simk@fb.com>
2024-04-21 12:00:30 +09:00
Ben Fekih, Hichem
4b8bcd2773 popup: call required_size only once while rendering
to speed up the rendering a little

Signed-off-by: Ben Fekih, Hichem <hichem.f@live.de>
2024-04-20 08:39:12 -04:00
Ben Fekih, Hichem
af4ff80524 Improve popup position
Make the popup positions more consistent.
Improvements:
1. if the signature popup content is bigger than the available space,
   then the popup is always shown under the cursor, even if there more
   space above the cursor than below
2. There is no mutation anymore inside required_size. Maybe in the future
   we can update all widgets to have no mutations and change the trait

Signed-off-by: Ben Fekih, Hichem <hichem.f@live.de>
2024-04-20 08:39:12 -04:00
Michael Davis
211f368064
Respect mode when starting a search (#10505)
Currently the editor mode has no effect on the behavior of `search` and
`rsearch`. We can pass in the right movement for the editor mode to make
the behavior or `search` and `rsearch` match `search_next` and
`search_prev` in select mode.
2024-04-20 10:25:11 +09:00
Sean Perry
30baff907d
Implement read command (#10447)
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
Co-authored-by: Ibrahim Dursun <ibrahim@dursun.cc>
2024-04-17 17:57:57 -05:00
ath3
521accaf00
Include "change" in textobject autoinfo (#10496) 2024-04-17 17:29:28 +02:00
Hichem
69e08d9e91
allow cycling through function signatures/overloads (#9974)
implement handle_event to cycle through the function signatures.

To change the signature press alt+p/n .

Signed-off-by: Ben Fekih, Hichem <hichem.f@live.de>
2024-04-16 20:57:22 +02:00
Matthew Bourke
8e161723ee
Enabled traversing multiple buffers at once (#10463)
* Enable traversing multiple buffers at once

* run cargo fmt

* simplify iterator call
2024-04-16 15:59:45 +02:00
Pascal Kuthe
73d26d0d97
don't manually grapheme align ts highlights (#10310) 2024-04-11 00:14:08 +09:00
Pascal Kuthe
f601b7c278
fix char/byte index mixup in overlay rendering (#10317) 2024-04-10 01:49:30 +09:00
Skyler Hawthorne
c99c333337 Use new in-crate TreeCursor 2024-04-09 10:33:15 -04:00
Skyler Hawthorne
fa67c5c474 feat(command): select_all_children 2024-04-09 10:33:15 -04:00
Skyler Hawthorne
87c4161732 feat(command): select_all_siblings 2024-04-09 10:33:15 -04:00
Evgeniy Tatarkin
07cb24abdd
Respect lsp definition order for code actions (#9590) 2024-04-09 09:28:54 -05:00
Hichem
ea2a4858b7
Fix scrolling to the end within a popup (#10181)
when the available height for the popup is low/small, then it is not
possible to scroll until the end

Signed-off-by: Ben Fekih, Hichem <hichem.f@live.de>
2024-04-08 10:41:03 -05:00
Diego
92338bc207
fix mouse right click selection (#10067) 2024-04-08 10:20:53 -05:00
TornaxO7
e69292e5eb
Improve goto_file_impl (#9065) 2024-04-06 16:27:29 -05:00
Michael Davis
f240d896a4
Merge unnecessary/deprecated diagnostic highlights separately (#10084)
Previously unnecessary/deprecated diagnostic tags replaced the highlight
for the severity of a diagnostic. This could cause either the severity
or unnecessary/deprecated scopes to disappear when diagnostic ranges
overlapped though. Plus the severity highlight can be interesting in
addition to the unnecessary/deprecated highlight.

So this change separates the unnecessary and deprecated highlights from
the severity highlights, so each is merged separately and when they
overlap, the highlights are combined.
2024-04-05 14:50:41 +09:00
Harishankar G
962c714185
Use an enum to represent yank decision during deletion of a selection (#10148) 2024-04-05 00:18:48 +09:00
Tshepang Mbambo
3e2b85c61b
remove redundant imports (#10154) 2024-04-04 23:28:44 +09:00
Harishankar G
f773972241
Use a boolean to indicate whether to yank during deletion of a selection (#10132) 2024-04-03 12:40:55 -05:00
woojiq
cc8290f393
show newest options in jumplist picker first, fix docs (#10095)
* docs: mention `<space>g` changed file picker

* picker(jumplist): show jumps in order from latest to oldest
2024-04-02 16:39:44 +02:00
Jonathan LEI
a224ee5079
Changed file picker (#5645)
Co-authored-by: WJH <hou32hou@gmail.com>
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
Co-authored-by: Pascal Kuthe <pascalkuthe@pm.me>
2024-03-31 17:36:28 -05:00
Daniel S Poulin
1abb64e48d
Add textobject for entries/elements of list-like things (#8150) 2024-03-31 11:53:15 -05:00
Gokul Soumya
957d030be9
Support scrolling popup contents using mouse (#10053)
* Extract popup scrolling code into named functions

* Scroll popup contents on mouse scroll event

* Ignore mouse events outside the popup

* Remove unneeded return statement
2024-03-31 14:47:13 +02:00
Michael Davis
cb286b7a5d
Fix rustc warnings about unused 'pub use's (#10011) 2024-03-27 14:34:47 +09:00
Michael Davis
07e21a10f0
Revert "helix-term: allow to backspace out-of the command prompt (#9828)" (#10005)
This reverts commit 0dc67ff885.

See the post-merge discussion in #9828. The old behavior was less
surprising and we have other ways to abort from a prompt, so let's
revert the behavior change.
2024-03-26 14:49:39 +09:00
Blaž Hrastnik
a0d6566140
Fix regression in color-modes
Fixes #10006
2024-03-26 14:46:56 +09:00
Quentin
614a744d24
Add narrow no-break space support (#9604) 2024-03-25 10:29:36 +09:00
Pascal Kuthe
b46064b8c4 Add an Amp-like jump command
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2024-03-23 15:35:25 +09:00
Pascal Kuthe
66b9ff1d2a dismiss pending keys properly for mouse/paste 2024-03-23 15:35:25 +09:00
Pascal Kuthe
69e07ab61e use slices instead of Rc for virtual text 2024-03-23 15:35:25 +09:00
Michael Davis
68b21578ac Reimplement tree motions in terms of syntax::TreeCursor
This uses the new TreeCursor type from the parent commit to reimplement
the tree-sitter motions (`A-p/o/i/n`). Other tree-sitter related
features like textobjects are not touched with this change and will
need a different, unrelated approach to solve.
2024-03-23 15:32:34 +09:00