From 9e061578a07854bb57431a5c08c4efb566bccb9a 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 | 4 +++- helix-view/src/editor.rs | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index 0e9aa5f1f9dc..78602734e60c 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -113,7 +113,9 @@ impl EditorView { } } - Self::highlight_cursorline(doc, view, surface, theme); + 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 dd805c000dc4..d7e499c515ec 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(),