- 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>
This commit is contained in:
Conrad Irwin 2024-02-02 19:24:36 -07:00 committed by GitHub
parent e1efa7298e
commit f09da1a1c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 57 additions and 28 deletions

View file

@ -1,4 +1,4 @@
use editor::{scroll::VERTICAL_SCROLL_MARGIN, test::editor_test_context::ContextHandle};
use editor::test::editor_test_context::ContextHandle;
use gpui::{px, size, Context};
use indoc::indoc;
use settings::SettingsStore;
@ -155,9 +155,7 @@ impl NeovimBackedTestContext {
pub async fn set_scroll_height(&mut self, rows: u32) {
// match Zed's scrolling behavior
self.neovim
.set_option(&format!("scrolloff={}", VERTICAL_SCROLL_MARGIN))
.await;
self.neovim.set_option(&format!("scrolloff={}", 3)).await;
// +2 to account for the vim command UI at the bottom.
self.neovim.set_option(&format!("lines={}", rows + 2)).await;
let (line_height, visible_line_count) = self.editor(|editor, cx| {