From a297513f3f4b3d369d200cb12ab7c66ed29690d1 Mon Sep 17 00:00:00 2001 From: TobTobXX Date: Wed, 20 Apr 2022 02:55:09 +0200 Subject: [PATCH] Create cursorline config key --- helix-term/src/ui/editor.rs | 5 ++++- helix-view/src/editor.rs | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index 0e9aa5f1f9dcb..8bc2426525a92 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -113,7 +113,10 @@ impl EditorView { } } - Self::highlight_cursorline(doc, view, surface, theme); + log::info!("{:?}", editor.config().cursorline); + if editor.config().cursorline { + Self::highlight_cursorline(doc, view, surface, theme); + } let highlights = Self::doc_syntax_highlights(doc, view.offset, inner.height, theme); let highlights = syntax::merge(highlights, Self::doc_diagnostics_highlights(doc, theme)); diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index dd805c000dc43..d7e499c515ec8 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -117,6 +117,8 @@ pub struct Config { pub shell: Vec, /// Line number mode. pub line_number: LineNumber, + /// Highlight the lines cursors are currently on. Defaults to false. + pub cursorline: bool, /// Gutters. Default ["diagnostics", "line-numbers"] pub gutters: Vec, /// Middle click paste support. Defaults to true. @@ -273,6 +275,7 @@ impl Default for Config { vec!["sh".to_owned(), "-c".to_owned()] }, line_number: LineNumber::Absolute, + cursorline: false, gutters: vec![GutterType::Diagnostics, GutterType::LineNumbers], middle_click_paste: true, auto_pairs: AutoPairConfig::default(),