Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File explorer and tree helper (v3) #5768

Open
wants to merge 118 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
b652f96
tree helper and file explorer
cossonleo Apr 3, 2022
d9d4daa
feat(ui/explore): implement "focus current file"
wongjiahau Feb 1, 2023
c446c39
feat(explorer/position): right
wongjiahau Feb 6, 2023
d04a1ce
refactor(tree): change internal implementation
wongjiahau Feb 11, 2023
aa397ef
feat(explore): reveal current file
wongjiahau Feb 12, 2023
bdab93e
feat(explore): search
wongjiahau Feb 12, 2023
82fe4a3
test(ui/tree): find
wongjiahau Feb 12, 2023
0f8b641
feat(tree): filter
wongjiahau Feb 12, 2023
458fa1c
feat(explore): add folder/file
wongjiahau Feb 13, 2023
2af8b41
feat(explore): remove files/folder
wongjiahau Feb 13, 2023
44b46dd
feat(explore): rename file/folder
wongjiahau Feb 13, 2023
5a5a1de
fix(explore/rename): should regenarate index
wongjiahau Feb 13, 2023
52a26ff
feat(explore): refresh
wongjiahau Feb 13, 2023
ec2059b
style(ui/tree): highlight ancestor
wongjiahau Feb 13, 2023
ddb7564
feat(explore): add help
wongjiahau Feb 13, 2023
2bafac0
feat(explore): go to previous root
wongjiahau Feb 13, 2023
35ffc60
feat(explore): increase/decrease explorer size
wongjiahau Feb 13, 2023
2c221f0
fix(explore): help page overflow
wongjiahau Feb 13, 2023
790192d
doc(explorer): up to date
wongjiahau Feb 13, 2023
b38a941
feat(explore): close without clearing previous state
wongjiahau Feb 13, 2023
56056e8
fix(explore): increase size will cause panic
wongjiahau Feb 14, 2023
a079477
fix(compile): warnings
wongjiahau Feb 14, 2023
85fa1c5
feat(explore):
wongjiahau Feb 14, 2023
9bd534b
fix(explore): filter
wongjiahau Feb 14, 2023
7249536
fix(explore): 'h' does not realign preview properly
wongjiahau Feb 14, 2023
94e2c29
fix(command): space e does not focus explorer when no files are opened
wongjiahau Feb 15, 2023
374b8dd
style(explore): make Right the default position
wongjiahau Feb 15, 2023
c8578ba
fix: warnings
wongjiahau Feb 15, 2023
30bac64
Revert "style(explore): make Right the default position"
wongjiahau Feb 15, 2023
ef73559
fix(explore): cannot focus explorer if no opened document
wongjiahau Feb 15, 2023
0f8e0a5
fix(tree): deleting last file causes panic
wongjiahau Feb 15, 2023
70984fd
Merge branch 'master' of https://github.com/helix-editor/helix into r…
wongjiahau Feb 15, 2023
f0a4b10
Merge branch 'refactor-tree-explorer' of github.com:pinelang/helix-tr…
wongjiahau Feb 15, 2023
4dfa869
style(tree): increase indentation
wongjiahau Feb 16, 2023
c88164f
feat(tree-view): add unit tests
wongjiahau Feb 16, 2023
64059fb
feat(tree): move left/right
wongjiahau Feb 19, 2023
2a60662
feat(explore): add focus indicator
wongjiahau Feb 20, 2023
2e654a0
refactor(explore): move search function to Tree
wongjiahau Feb 20, 2023
2e7709e
MULTI
wongjiahau Feb 21, 2023
a259c20
fix(explore): help overflow
wongjiahau Feb 22, 2023
bcb1672
fix(explore):
wongjiahau Feb 22, 2023
78bb297
Merge branch 'master' of https://github.com/helix-editor/helix into a…
wongjiahau Feb 22, 2023
6321dc9
chore: rename explore to explorer
wongjiahau Feb 22, 2023
7b63fda
test(explorer): add integration tests
wongjiahau Feb 23, 2023
f9ff01d
chore(ui/tree): bind 'o' to Toggle
wongjiahau Feb 23, 2023
899491b
feat(tree): add C-n/C-p keybinding
wongjiahau Feb 23, 2023
6af9a06
feat(explorer): bind "="/"_" to "Zoom in"/"Zoom out"
wongjiahau Feb 23, 2023
9205117
fix: failing tests
wongjiahau Feb 23, 2023
cf9b60a
feat(tree): sticky ancestors
wongjiahau Feb 25, 2023
dffbc15
refactor(explorer,tree): remove unwrap to avoid panics
wongjiahau Feb 25, 2023
36769cb
fix(explorer/keymap): change 'b' to 'B'
wongjiahau Feb 25, 2023
b5d92ac
chore: fix clippy warnings
wongjiahau Feb 25, 2023
38ef079
feat(tree): jump forward
wongjiahau Feb 25, 2023
24b50bb
feat(explorer): toggle preview
wongjiahau Feb 25, 2023
72b845d
Merge branch 'master' of https://github.com/helix-editor/helix into t…
wongjiahau Feb 25, 2023
ba00a80
fix(tree): shouldn't use patched font
wongjiahau Feb 25, 2023
601f2c4
chore(ui/tree): remove useless comments
wongjiahau Feb 25, 2023
ef18502
chore: remove temp file
wongjiahau Feb 25, 2023
5d600fe
doc(helix-term/.gitignore): document purpose of test-explorer
wongjiahau Feb 25, 2023
d578f8a
chore: fix clippy warning
wongjiahau Feb 26, 2023
c3b8be9
fix(ci): clippy + failure on Windows
wongjiahau Feb 26, 2023
c0073ed
Merge branch 'tree_explore' of github.com:pinelang/helix-tree-explore…
wongjiahau Feb 26, 2023
4a0c620
fix(explorer/filter): not working for newly opened folder
wongjiahau Feb 26, 2023
7e4feb0
fix(explore): search using previous search word after filter does not…
wongjiahau Feb 27, 2023
fae4990
test(tree): search prompt and filter prompt
wongjiahau Feb 28, 2023
8379669
Merge branch 'master' of https://github.com/helix-editor/helix into t…
wongjiahau Feb 28, 2023
b18a974
fix(explorer): go to previous root does not update state.current_root
wongjiahau Feb 28, 2023
19d436e
Merge branch 'master' of https://github.com/helix-editor/helix into t…
wongjiahau Mar 1, 2023
a2cb28d
chore(keymap): merge with the correct version
wongjiahau Mar 1, 2023
43b226a
feat(explorer/keymap): combine 'a' with 'A'
wongjiahau Mar 2, 2023
c2e2f05
feat(explorer/delete): no need to press Enter, just press y
wongjiahau Mar 2, 2023
a4943a7
fix(explorer/overlay): prompt overflow
wongjiahau Mar 2, 2023
8ef95ee
Merge branch 'master' of https://github.com/helix-editor/helix into t…
wongjiahau Mar 6, 2023
d3db1b6
style(tree): improve ancestor contrast
wongjiahau Mar 6, 2023
31c0e84
fix(ci): failing windows test & clippy
wongjiahau Mar 6, 2023
bc62b76
fix(ci): failing windows test & clippy
wongjiahau Mar 6, 2023
aa6780e
feat(ui/tree): tree-based movements
wongjiahau Mar 7, 2023
80a2f86
Merge branch 'tree_explore' of github.com:pinelang/helix-tree-explore…
wongjiahau Mar 7, 2023
d62b487
feat(ui/tree): undo breaking changes
wongjiahau Mar 7, 2023
d1e6a21
Merge branch 'master' of https://github.com/helix-editor/helix into t…
wongjiahau Mar 7, 2023
e991ed9
refactor(runtime/themes): revert changes to theme files
wongjiahau Mar 7, 2023
9726ae7
fix(ci/test): failing on Windows
wongjiahau Mar 7, 2023
7ccee10
chore: correction of e991ed9
wongjiahau Mar 7, 2023
10032eb
fix(ci): cargo fmt
wongjiahau Mar 8, 2023
d043ea4
Merge branch 'master' of https://github.com/helix-editor/helix into t…
wongjiahau Mar 8, 2023
1108c88
Merge branch 'master' into tree_explore
wongjiahau Mar 9, 2023
eb9287d
fix(ci): cargo fmt and windows test
wongjiahau Mar 9, 2023
20241fb
Merge branch 'master' of https://github.com/helix-editor/helix into t…
wongjiahau Mar 13, 2023
54b1693
Merge branch 'master' of https://github.com/helix-editor/helix into t…
wongjiahau Mar 14, 2023
c4c3e80
style(explorer/delete): capitalize default choice
wongjiahau Mar 14, 2023
1780867
refactor(ui/explorer/handle_prompt_event): remove unnecessary function
wongjiahau Mar 14, 2023
9a1aff2
refactor(ui/explorer/close_documents): concise code
wongjiahau Mar 14, 2023
8b561e2
fix: type error
wongjiahau Mar 14, 2023
41ebc30
fix(ui/tree/clone): `is_openend` should not be false
wongjiahau Mar 14, 2023
52be2e0
refactor(ui/tree): remove filter
wongjiahau Mar 16, 2023
f5af209
refactor(explorer): remove preview
wongjiahau Mar 17, 2023
afda68a
chore: cargo fmt
wongjiahau Mar 17, 2023
e5dfde2
refactor(explorer): remove overlay option
wongjiahau Mar 17, 2023
1be2ac2
fix(ui/explorer): tree search cursor not rendered
wongjiahau Mar 18, 2023
ee34720
style(explorer): move title to statusline
wongjiahau Mar 18, 2023
404f950
fix(tests/explorer/new_folder): failing on Windows
wongjiahau Mar 22, 2023
898c167
fix(integration-test/test_goto_file_impl): failing due to untested ch…
wongjiahau Mar 22, 2023
33542e9
refactor: remove unnecessary dev-dependencies
wongjiahau Mar 22, 2023
f5aec54
chore(commands): revert accidental typo
wongjiahau Mar 22, 2023
a331e52
chore(keymap): remove "<space>E"
wongjiahau Mar 22, 2023
eebff62
chore(doc/configuration/explorer/position): remove `overlay` option
wongjiahau Mar 22, 2023
f37c795
chore(ui/prompt): use &str instead of Cow<str>
wongjiahau Mar 23, 2023
88ac941
Merge branch 'master' of https://github.com/helix-editor/helix into t…
wongjiahau Mar 25, 2023
cf9669f
fix(ci): clippy error
wongjiahau Mar 27, 2023
e2c3757
Merge branch 'master' of https://github.com/helix-editor/helix into t…
wongjiahau May 12, 2023
2d1ca23
refactor(explorer/tests): use tempfile instead
wongjiahau May 12, 2023
4fe9896
chore(book/src/configuration.md): remove accidental addition
wongjiahau May 12, 2023
d86abf1
chore(explorer): minor code changes
wongjiahau May 12, 2023
0885057
perf(tree/reveal-item): remove over-conservative refresh
wongjiahau May 16, 2023
99e3db4
Merge branch 'master' of https://github.com/helix-editor/helix into t…
wongjiahau Jun 16, 2023
10f302d
Merge branch 'master' of https://github.com/helix-editor/helix into t…
wongjiahau Jul 25, 2023
fd80660
Merge branch 'master' of https://github.com/helix-editor/helix into t…
wongjiahau Jul 31, 2023
2c27974
Merge branch 'master' of https://github.com/helix-editor/helix into t…
wongjiahau Aug 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
208 changes: 108 additions & 100 deletions book/src/configuration.md

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions book/src/keymap.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ This layer is a kludge of mappings, mostly pickers.
| `R` | Replace selections by clipboard contents | `replace_selections_with_clipboard` |
| `/` | Global search in workspace folder | `global_search` |
| `?` | Open command palette | `command_palette` |
| `e` | Reveal current file in explorer | `reveal_current_file` |


> 💡 Global search displays results in a fuzzy picker, use `Space + '` to bring it back up after opening a file.

Expand Down Expand Up @@ -452,3 +454,7 @@ Keys to use within prompt, Remapping currently not supported.
| `Tab` | Select next completion item |
| `BackTab` | Select previous completion item |
| `Enter` | Open selected |

# File explorer

Press `?` to see keymaps. Remapping currently not supported.
45 changes: 45 additions & 0 deletions helix-term/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,8 @@ impl MappableCommand {
record_macro, "Record macro",
replay_macro, "Replay macro",
command_palette, "Open command palette",
open_or_focus_explorer, "Open or focus explorer",
reveal_current_file, "Reveal current file in explorer",
);
}

Expand Down Expand Up @@ -2623,6 +2625,49 @@ fn file_picker_in_current_directory(cx: &mut Context) {
cx.push_layer(Box::new(overlaid(picker)));
}

fn open_or_focus_explorer(cx: &mut Context) {
cx.callback = Some(Box::new(
|compositor: &mut Compositor, cx: &mut compositor::Context| {
if let Some(editor) = compositor.find::<ui::EditorView>() {
match editor.explorer.as_mut() {
Some(explore) => explore.focus(),
None => match ui::Explorer::new(cx) {
Ok(explore) => editor.explorer = Some(explore),
Comment on lines +2633 to +2635
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small typo: explore => explorer

Err(err) => cx.editor.set_error(format!("{}", err)),
},
}
}
},
));
}

fn reveal_file(cx: &mut Context, path: Option<PathBuf>) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fn reveal_file(cx: &mut Context, path: Option<PathBuf>) {
fn reveal_file_in_explorer(cx: &mut Context, path: Option<PathBuf>) {

since commands are globally namespaced this should be a little more specific about where it's being revealed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it may also make sense to call this "focus" or "select" rather than "reveal" to match the vocabulary used in TreeView::set_selected.

cx.callback = Some(Box::new(
|compositor: &mut Compositor, cx: &mut compositor::Context| {
if let Some(editor) = compositor.find::<ui::EditorView>() {
(|| match editor.explorer.as_mut() {
wongjiahau marked this conversation as resolved.
Show resolved Hide resolved
Some(explorer) => match path {
Some(path) => explorer.reveal_file(path),
None => explorer.reveal_current_file(cx),
},
None => {
editor.explorer = Some(ui::Explorer::new(cx)?);
if let Some(explorer) = editor.explorer.as_mut() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is safe to just unwrap, given we just created a new one, and if that fails, we return before it gets to this line.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Option::insert sets the Option and returns a mutable reference.

explorer.reveal_current_file(cx)?;
}
Ok(())
}
})()
.unwrap_or_else(|err| cx.editor.set_error(err.to_string()))
}
},
));
Comment on lines +2645 to +2664
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The IIFE is really unnatural looking here and elsewhere. It's a pattern we don't use in the codebase at all AFAIK. I'd like to see them all eliminated.

This and open_or_focus_explorer share some code to ensure that the explorer is open. They could be refactored to share some code so that the Option/Result handling is explicit and not duplicated:

fn with_explorer<F>(cx: &mut Context, with_explorer_fn: F)
where
    F: FnOnce(&mut ui::Explorer, &mut compositor::Context) + 'static,
{
    cx.callback = Some(Box::new(
        move |compositor: &mut Compositor, cx: &mut compositor::Context| {
            let Some(editor) = compositor.find::<ui::EditorView>() else { return };

            if let Some(explorer) = editor.explorer.as_mut() {
                with_explorer_fn(explorer, cx);
                return;
            }

            // Open the explorer.
            let explorer = match ui::Explorer::new(cx) {
                Ok(explorer) => {
                    editor.explorer = Some(explorer);
                    editor.explorer.as_mut().unwrap()
                }
                Err(err) => {
                    cx.editor.set_error(err.to_string());
                    return;
                }
            };

            with_explorer_fn(explorer, cx);
        },
    ));
}

}

fn reveal_current_file(cx: &mut Context) {
reveal_file(cx, None)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function should have the logic in Explorer::reveal_current_file rather than passing in None here and figuring it out later. Something like:

fn reveal_current_file(cx: &mut Context) {
    match doc!(cx.editor).path() {
        Some(path) => reveal_file(cx, path.clone()),
        None => open_or_focus_explorer(cx),
    }
}

And this also simplifies reveal_file.

}

fn buffer_picker(cx: &mut Context) {
let current = view!(cx.editor).doc;

Expand Down
56 changes: 56 additions & 0 deletions helix-term/src/compositor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,47 @@ impl<'a> Context<'a> {
tokio::task::block_in_place(|| helix_lsp::block_on(self.editor.flush_writes()))?;
Ok(())
}

/// Purpose: to test `handle_event` without escalating the test case to integration test
/// Usage:
/// ```
/// let mut editor = Context::dummy_editor();
/// let mut jobs = Context::dummy_jobs();
/// let mut cx = Context::dummy(&mut jobs, &mut editor);
/// ```
#[cfg(test)]
pub fn dummy(jobs: &'a mut Jobs, editor: &'a mut helix_view::Editor) -> Context<'a> {
Context {
jobs,
scroll: None,
editor,
}
}

#[cfg(test)]
pub fn dummy_jobs() -> Jobs {
Jobs::new()
}

#[cfg(test)]
pub fn dummy_editor() -> Editor {
use crate::config::Config;
use arc_swap::{access::Map, ArcSwap};
use helix_core::syntax::{self, Configuration};
use helix_view::theme;
use std::sync::Arc;

let config = Arc::new(ArcSwap::from_pointee(Config::default()));
Editor::new(
Rect::new(0, 0, 60, 120),
Arc::new(theme::Loader::new(&[])),
Arc::new(syntax::Loader::new(Configuration { language: vec![] })),
Arc::new(Arc::new(Map::new(
Arc::clone(&config),
|config: &Config| &config.editor,
))),
)
}
}

pub trait Component: Any + AnyComponent {
Expand Down Expand Up @@ -72,6 +113,21 @@ pub trait Component: Any + AnyComponent {
fn id(&self) -> Option<&'static str> {
None
}

#[cfg(test)]
/// Utility method for testing `handle_event` without using integration test.
/// Especially useful for testing helper components such as `Prompt`, `TreeView` etc
fn handle_events(&mut self, events: &str) -> anyhow::Result<()> {
use helix_view::input::parse_macro;

let mut editor = Context::dummy_editor();
let mut jobs = Context::dummy_jobs();
let mut cx = Context::dummy(&mut jobs, &mut editor);
for event in parse_macro(events)? {
self.handle_event(&Event::Key(event), &mut cx);
}
Ok(())
}
}

pub struct Compositor {
Expand Down
1 change: 1 addition & 0 deletions helix-term/src/keymap/default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ pub fn default() -> HashMap<Mode, KeyTrie> {
"r" => rename_symbol,
"h" => select_references_to_symbol_under_cursor,
"?" => command_palette,
"e" => reveal_current_file,
Comment on lines 279 to +280
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move this binding up so that it's just under F. Then the file commands are grouped.

},
"z" => { "View"
"z" | "c" => align_view_center,
Expand Down
70 changes: 63 additions & 7 deletions helix-term/src/ui/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::{
keymap::{KeymapResult, Keymaps},
ui::{
document::{render_document, LinePos, TextRenderer, TranslatedPosition},
Completion, ProgressSpinners,
Completion, Explorer, ProgressSpinners,
},
};

Expand All @@ -23,7 +23,7 @@ use helix_core::{
};
use helix_view::{
document::{Mode, SavePoint, SCRATCH_BUFFER_NAME},
editor::{CompleteAction, CursorShapeConfig},
editor::{CompleteAction, CursorShapeConfig, ExplorerPosition},
graphics::{Color, CursorKind, Modifier, Rect, Style},
input::{KeyEvent, MouseButton, MouseEvent, MouseEventKind},
keyboard::{KeyCode, KeyModifiers},
Expand All @@ -43,6 +43,7 @@ pub struct EditorView {
pub(crate) last_insert: (commands::MappableCommand, Vec<InsertEvent>),
pub(crate) completion: Option<Completion>,
spinners: ProgressSpinners,
pub(crate) explorer: Option<Explorer>,
}

#[derive(Debug, Clone)]
Expand Down Expand Up @@ -71,6 +72,7 @@ impl EditorView {
last_insert: (commands::MappableCommand::normal_mode, Vec::new()),
completion: None,
spinners: ProgressSpinners::default(),
explorer: None,
}
}

Expand Down Expand Up @@ -1227,6 +1229,11 @@ impl Component for EditorView {
event: &Event,
context: &mut crate::compositor::Context,
) -> EventResult {
if let Some(explore) = self.explorer.as_mut() {
if let EventResult::Consumed(callback) = explore.handle_event(event, context) {
return EventResult::Consumed(callback);
}
}
let mut cx = commands::Context {
editor: context.editor,
count: None,
Expand Down Expand Up @@ -1389,6 +1396,8 @@ impl Component for EditorView {
surface.set_style(area, cx.editor.theme.get("ui.background"));
let config = cx.editor.config();

let editor_area = area.clip_bottom(1);

// check if bufferline should be rendered
use helix_view::editor::BufferLine;
let use_bufferline = match config.bufferline {
Expand All @@ -1397,15 +1406,43 @@ impl Component for EditorView {
_ => false,
};

// -1 for commandline and -1 for bufferline
let mut editor_area = area.clip_bottom(1);
if use_bufferline {
editor_area = editor_area.clip_top(1);
}
let editor_area = if use_bufferline {
pascalkuthe marked this conversation as resolved.
Show resolved Hide resolved
editor_area.clip_top(1)
} else {
editor_area
};

let editor_area = if let Some(explorer) = &self.explorer {
let explorer_column_width = if explorer.is_opened() {
explorer.column_width().saturating_add(2)
} else {
0
};
// For future developer:
// We should have a Dock trait that allows a component to dock to the top/left/bottom/right
// of another component.
match config.explorer.position {
ExplorerPosition::Left => editor_area.clip_left(explorer_column_width),
ExplorerPosition::Right => editor_area.clip_right(explorer_column_width),
}
} else {
editor_area
};

// if the terminal size suddenly changed, we need to trigger a resize
cx.editor.resize(editor_area);

if let Some(explorer) = self.explorer.as_mut() {
if !explorer.is_focus() {
let area = if use_bufferline {
area.clip_top(1)
} else {
area
};
explorer.render(area, surface, cx);
}
}

if use_bufferline {
Self::render_bufferline(cx.editor, area.with_height(1), surface);
}
Expand Down Expand Up @@ -1484,9 +1521,28 @@ impl Component for EditorView {
if let Some(completion) = self.completion.as_mut() {
completion.render(area, surface, cx);
}

if let Some(explore) = self.explorer.as_mut() {
if explore.is_focus() {
let area = if use_bufferline {
pascalkuthe marked this conversation as resolved.
Show resolved Hide resolved
area.clip_top(1)
} else {
area
};
explore.render(area, surface, cx);
}
}
}

fn cursor(&self, _area: Rect, editor: &Editor) -> (Option<Position>, CursorKind) {
if let Some(explore) = &self.explorer {
if explore.is_focus() {
let cursor = explore.cursor(_area, editor);
if cursor.0.is_some() {
return cursor;
}
}
}
match editor.cursor() {
// All block cursors are drawn manually
(pos, CursorKind::Block) => (pos, CursorKind::Hidden),
Expand Down
Loading