Skip to content

Commit

Permalink
Prevent multicursor interference when none are present
Browse files Browse the repository at this point in the history
  • Loading branch information
curlpipe committed Nov 7, 2024
1 parent edab34e commit 40cb033
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,10 @@ fn run(cli: &CommandLineInterface) -> Result<()> {

// Handle multi cursors
if let CEvent::Key(_) = event {
if ged!(&editor).active && allowed_by_multi_cursor(&event) {
let has_multicursors = !ged!(&editor)
.try_doc()
.map_or(true, |doc| doc.secondary_cursors.is_empty());
if ged!(&editor).active && allowed_by_multi_cursor(&event) && has_multicursors {
handle_multiple_cursors(&editor, &event, &lua, &original_loc)?;
}
}
Expand Down

0 comments on commit 40cb033

Please sign in to comment.