Commit Graph
39 Commits
Author SHA1 Message Date
Piotr Osiewicz 8c8a74b87d chore: Wrap WorkspaceId in newtype (#9492)
Release Notes:

- N/A
2024-03-18 12:39:03 +01:00
Marshall Bowers aea1b34132 Enable clippy::useless_conversion (#8724)
This PR enables the
[`clippy::useless_conversion`](https://rust-lang.github.io/rust-clippy/master/index.html#/useless_conversion)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 16:31:47 -05:00
bc3ec60520 vim hml (#7298)
- Add a setting for `vertical_scroll_offset`
- Fix H/M/L in vim with scrolloff



Release Notes:

- Added a settings for `vertical_scroll_offset`
- vim: Fix H/M/L with various values of vertical_scroll_offset

---------

Co-authored-by: Vbhavsar <vbhavsar@gmail.com>
Co-authored-by: fdionisi <code@fdionisi.me>
2024-02-02 19:24:36 -07:00
953f5c9d35 gpui: Add Global marker trait (#7095)
This should prevent a class of bugs where one queries the wrong type of
global, which results in oddities at runtime.

Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-01-30 14:08:20 -05:00
Vishal Bhavsar 74b47eff43 vim: Add support for moving to first, middle and last visible lines (H, L, M) (#6919)
This change implements the vim
[motion](https://github.com/vim/vim/blob/master/runtime/doc/motion.txt)
commands to move the cursor to the top, middle and bottom of the visible
view. This feature is requested in
https://github.com/zed-industries/zed/issues/4941.

This change takes inspiration from
[crates/vim/src/normal/scroll.rs](https://github.com/zed-industries/zed/blob/main/crates/vim/src/normal/scroll.rs).

A note on the behavior of these commands: Because
`NeovimBackedTestContext` requires compatibility with nvim, the current
implementation causes slightly non-standard behavior: it causes the
editor to scroll a few lines. The standard behavior causes no scrolling.
It is easy enough to account for the margin by adding
`VERTICAL_SCROLL_MARGIN`. However, doing so will cause test failures due
to the disparity between nvim and zed states. Perhaps
`NeovimBackedTestContext` should have a switch to be more tolerant for
such cases.

Release Notes:

- Added support for moving to top, middle and bottom of the screen in
vim mode (`H`, `M`, and `L`)
([#4941](https://github.com/zed-industries/zed/issues/4941)).
2024-01-29 20:58:24 -07:00
Thorsten BallandAntonio 7598e29236 Fix horizontal scroll going too far to the left
Previously one could scroll infinitely to the left. This clams it to 0.

Co-authored-by: Antonio <antonio@zed.dev>
2024-01-23 12:28:50 +01:00
Julia da0f1288b0 Avoid overwriting mouse wheel scroll with selection auto-scroll 2024-01-22 18:12:25 -05:00
Piotr OsiewiczandKirill f4f65e9c2c Editor docs (#4097)
Release Notes:

- N/A

---------

Co-authored-by: Kirill <kirill@zed.dev>
2024-01-18 00:48:37 +01:00
Conrad Irwin ff33f08095 Fix panic in set_scroll_anchor_remote 2024-01-09 14:19:48 -07:00
Max BrunsfeldandMikayla 602d158320 Remove 2 suffix for editor
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-01-03 10:58:57 -08:00
Conrad Irwin ea19a9e284 Split ContextMenu actions
This should have no user-visible impact.

For vim `.` to repeat it's important that actions are replayable.
Currently editor::MoveDown *sometimes* moves the cursor down, and
*sometimes* selects the next completion.

For replay we need to be able to separate the two.
2023-09-02 21:04:19 -06:00
Conrad Irwin eb83265856 Fix cursor adjustment on scroll
Fixes: zed-industries/community#1929

Also preserves visual modes correctly.
2023-08-18 11:23:43 -06:00
Kirill Bulatov 08fcb3f10e Use InlayHint instead of Inlay where appropriate 2023-08-16 23:38:11 +03:00
Kirill Bulatov c941405bf9 Properly generate ranges to query 2023-08-14 11:25:02 +03:00
Kirill Bulatov 831b3e2c70 Do not add duplicate hints to the cache 2023-08-14 11:25:02 +03:00
Kirill Bulatov 383387a570 Query hints on every scroll 2023-08-14 11:25:02 +03:00
Kirill Bulatov c4dc09f02c Query hints when editors gets open and visible 2023-06-29 22:25:50 +03:00
Kirill Bulatov e1555caaae Simplify hint event management slightly 2023-06-29 22:25:49 +03:00
Kirill Bulatov a555d28a65 Move away heavy inlay computations into background tasks 2023-06-29 22:25:49 +03:00
Kirill Bulatov 0a2f26dcd7 React on multibuffer scrolls again 2023-06-29 22:25:49 +03:00
Kirill Bulatov c3d31a916e Do not track editor ranges in InlayHintCache 2023-06-29 22:25:49 +03:00
Kirill Bulatov 952872eeca Properly refresh hints on editor open 2023-06-29 22:25:49 +03:00
Kirill Bulatov ddd0f9caf4 Properly handle settings toggle 2023-06-29 22:25:49 +03:00
Kirill Bulatov 4ea380ad72 Use proper, limited excerpt ranges and manage inlay cache properly 2023-06-29 22:25:49 +03:00
Conrad Irwin 04a35ae515 vim: Fix scrolling
After #2641 we noticed that scrolling didn't take a count parameter.

The PageDown/PageUp logic was also broken by an additional -1 (for both
vim mode and not).
2023-06-26 13:29:14 -06:00
Antonio Scandurra 26adb28be2 Save cursor scroll position when the editor is auto-scrolled 2023-06-14 12:00:27 +02:00
Antonio Scandurra b9bd4b8efb Maintain scroll bottom when streaming assistant responses 2023-06-07 15:01:50 +02:00
Antonio Scandurra 279094ec8b Remove HideHover and HoverAt internal actions 2023-04-28 16:12:24 +02:00
Antonio Scandurra 6b87c371f9 Remove Jump internal action 2023-04-28 14:13:07 +02:00
Antonio Scandurra 0571bed115 Remove unnecessary calls to WeakViewHandle::upgrade 2023-04-26 11:13:46 +02:00
Antonio Scandurra 947421133a Replace ViewContext::spawn with ViewContext::spawn_weak 2023-04-26 10:23:27 +02:00
Antonio Scandurra 9254219f16 Fix warnings/errors now that AsyncAppContext::update returns Result 2023-04-18 14:58:57 +02:00
Nathan Sobo 5839c594d8 Fix formatting 2023-04-06 15:54:44 -06:00
Nathan Sobo d937660683 Merge MutableAppContext into AppContext
There may have been a good reason for the difference at some point, or I was
still learning Rust. But now it's just &mut AppContext vs &AppContext.
2023-04-06 15:49:03 -06:00
JuliaandAntonio Scandurra bffdd9afe4 Hide editor hover on mouse move out & always notify when hiding hover
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2023-01-20 10:16:24 -05:00
Mikayla MakiandKay 820037d796 Add serializing and restoring editor scroll position
Co-authored-by: Kay <kay@zed.dev>
2023-01-09 14:06:40 -08:00
c30daa21c6 Avoid breaking follow when syncing leader's scroll position
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
Co-authored-by: Kay Simmons <kay@zed.dev>
2022-12-12 15:36:30 -08:00
Kay Simmons b39cac2c5c fix failing tests from incorrect follow behavior 2022-12-07 17:25:48 -08:00
Kay Simmons acac7d292d Refactor editor scrolling and implement scroll commands from vim mode 2022-12-07 16:39:32 -08:00