diff options
author | Dmitry Sharshakov | 2021-08-10 05:35:20 +0000 |
---|---|---|
committer | GitHub | 2021-08-10 05:35:20 +0000 |
commit | 27b551d34593cd94a3fba016c3a7f2042f9d9d38 (patch) | |
tree | 7b5dfc930478783edcee65dd80ef9184f61dcd00 /helix-view | |
parent | b239f0f45ffd0993cffc2a676651a0770b705fb5 (diff) |
helix-term: handle scrolling when mouse is enabled (#554)
* helix-term: handle scrolling when mouse is enabled
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* helix-term: configure scrolling speed
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* helix-term: use new config for scrolling
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* config: defaults for edtior config
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* config: add scroll-lines property
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* helix-term: scroll hovered view
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* helix-term: support inverted scrolling
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* helix-term: remove duplicating code
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* helix-term: do not focus view while scrolled
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* helix-term: refactor mouse events and scrolling
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
* simplify
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
Diffstat (limited to 'helix-view')
-rw-r--r-- | helix-view/src/editor.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index e5ba0d51..ec3cedd6 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -21,10 +21,12 @@ use helix_core::Position; use serde::Deserialize; #[derive(Debug, Clone, PartialEq, Deserialize)] -#[serde(rename_all = "kebab-case")] +#[serde(rename_all = "kebab-case", default)] pub struct Config { /// Padding to keep between the edge of the screen and the cursor when scrolling. Defaults to 5. pub scrolloff: usize, + /// Number of lines to scroll at once. Defaults to 3 + pub scroll_lines: isize, /// Mouse support. Defaults to true. pub mouse: bool, } @@ -33,6 +35,7 @@ impl Default for Config { fn default() -> Self { Self { scrolloff: 5, + scroll_lines: 3, mouse: true, } } |