refactor: move modal paste policy into editor input
This commit is contained in:
+2
-5
@@ -21,7 +21,7 @@ use unicode_segmentation::UnicodeSegmentation;
|
||||
use unicode_width::UnicodeWidthStr;
|
||||
|
||||
use crate::{
|
||||
editor::{Editor, Effect, Input, Mode},
|
||||
editor::{Editor, Input, Mode},
|
||||
session::EditorSession,
|
||||
};
|
||||
|
||||
@@ -75,10 +75,7 @@ pub fn run(session: &mut EditorSession) -> io::Result<()> {
|
||||
session.handle(input);
|
||||
}
|
||||
}
|
||||
// Bracketed paste must never execute pasted Ex commands.
|
||||
Event::Paste(text) if session.editor().mode() == Mode::Insert => {
|
||||
session.apply(vec![Effect::Insert(text)]);
|
||||
}
|
||||
Event::Paste(text) => session.handle(Input::Paste(text)),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user