From 02ed2fe2cf569bc05f0a2f8f2f6c954dc3698ad8 Mon Sep 17 00:00:00 2001 From: ifengqi <362254883@qq.com> Date: Fri, 18 Oct 2024 16:11:46 +0800 Subject: [PATCH] Temporarily cancel the click event and set `Unfold` to default status, because being folded will cause a scrolling problem. (#3572) --- lapce-app/src/editor/gutter.rs | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/lapce-app/src/editor/gutter.rs b/lapce-app/src/editor/gutter.rs index c36f7287..1a8b76d3 100644 --- a/lapce-app/src/editor/gutter.rs +++ b/lapce-app/src/editor/gutter.rs @@ -311,21 +311,10 @@ pub fn from_lsp(value: lsp_types::FoldingRange) -> Self { start_character, end_line, end_character, - kind, collapsed_text, + .. } = value; - let status = if kind - .as_ref() - .map(|x| { - x == &lsp_types::FoldingRangeKind::Imports - // || x == &lsp_types::FoldingRangeKind::Comment - }) - .unwrap_or_default() - { - FoldingRangeStatus::Fold - } else { - FoldingRangeStatus::Unfold - }; + let status = FoldingRangeStatus::Unfold; Self { start: FoldingPosition { line: start_line, @@ -359,14 +348,14 @@ pub enum FoldingRangeStatus { impl FoldingRangeStatus { pub fn click(&mut self) { - match self { - FoldingRangeStatus::Fold => { - *self = FoldingRangeStatus::Unfold; - } - FoldingRangeStatus::Unfold => { - *self = FoldingRangeStatus::Fold; - } - } + // match self { + // FoldingRangeStatus::Fold => { + // *self = FoldingRangeStatus::Unfold; + // } + // FoldingRangeStatus::Unfold => { + // *self = FoldingRangeStatus::Fold; + // } + // } } pub fn is_folded(&self) -> bool { *self == Self::Fold