Commit graph

2202 commits

Author SHA1 Message Date
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
Jaakko Paju
d5c2973cd1
Fix repeat last motion for goto next/prev diagnostic (#9966) 2024-03-23 15:25:08 +09:00
Michael Davis
7f5fd63835
Evenly space statusline areas when there isn't space to align middle (#9950)
The refactor in bcf7b263 introduced a possible subtraction with overflow
when the statusline is layed out so that the left or right sides are
larger than the padding it would take to align the center area to the
middle.

When the left or right areas are too large, we can evenly space the
elements rather than trying to align the center area to the middle.
This prevents possible underflows and makes sense visually - it's
still easy to tell the areas apart at a glance.
2024-03-21 09:16:58 +09:00
Szabin
bcf7b26393
Refactor statusline elements to build Spans (#9122)
* Refactor statusline elements to return Spans

* Split render fn to build Spans and blit to Surface
2024-03-19 17:31:39 +01:00
Kirawi
d9de809a57
add register completion (#9936) 2024-03-19 17:26:32 +01:00
Tobias Hunger
1d1806c85a
Ignore more version control systems (#9935)
Ignore `.pijul` and `.jj` as well as `.git`. This makes hx so much more
usable with VCSes other than git!
2024-03-19 15:08:50 +01:00
Cyrill Schenkel
5b8bfc5476
Prevent shell_keep_pipe from stopping on nonzero exit status code (#9817)
The `shell_impl` and `shell_impl_async` functions no longer return
`success` because it was always `true`. If the command didn't succeed
both functions would return an `Err`.

This was also the reason, why `shell_keep_pipe` didn't work. It relied
upon the value of `success` and aborted in case of an `Err`.
It now removes any selection for which `shell_impl` returns `Err`.

If the command always fails, the selections are preserved and an error
message is displayed in the status bar.
2024-03-19 07:30:34 -05:00
Luis Useche
6a22d7d1ca
Do not stop reloading docs on error (#9870)
In the `reload-all` command, we should not stop reloading the documents
if one error is found. Instead, we should report the error and continue
trying to reload the current open documents. This is useful in cases
where a backing file does not exist temporarily (e.g. when editing a git
patch in the outstanding chain that doesn't have a file just yet).

This change also remove the error messages in the cases where the
backing is `None`, like in new docs or `tutor`.
2024-03-19 12:16:30 +01:00
mo8it
e91ec8e880 Optimize getting a relative path 2024-03-19 14:39:46 +09:00
Dan Cardamore
3890376a23
add 'file-absolute-path' to statusline (#4535)
* feat: add 'file-abs-path' to statusline (#4434)

* cleanup implementation

* rename to be non-abbreviated names

---------

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2024-03-17 23:55:49 +01:00
Emi
761df60077
Keybind for Extend/shrink selection up and down (#9080)
* implement another selection modifying command

* Selection feels more ergonomic in case of swapping the direction. This also fixes a problem when starting at an empty line.

* rename select_line_up/down to select_line_above/below

* apply clippy suggestion of using cmp instead of if-chain

* revert `Extent` implementing `Clone/Copy`

* move select_line functions below extend_line implementations

* implement help add function, which saturates at the number of text lines

---------

Co-authored-by: Emi <emanuel.boehm@gmail.com>
2024-03-17 23:06:24 +01:00