refactor: move modal paste policy into editor input

This commit is contained in:
Valdemar Lorenzen
2026-10-05 14:30:40 +02:00
parent 73b15f5134
commit 01805bba0e
4 changed files with 110 additions and 23 deletions
+1 -10
View File
@@ -5,7 +5,7 @@ use std::{
};
use crate::{
editor::{Editor, Effect, Input, Invocation},
editor::{Editor, Input, Invocation},
ruby::{Config, RubyPlugin, load_config},
};
@@ -77,15 +77,6 @@ impl EditorSession {
}
}
/// Applies frontend effects, such as the TUI's existing Insert-mode paste.
/// Plugin results are applied internally by dispatch, with owner retirement
/// on rejection; frontend effects have no plugin owner to retire.
pub fn apply(&mut self, effects: Vec<Effect>) {
if let Err(error) = self.editor.apply(effects) {
self.editor.set_message(error);
}
}
fn dispatch(&mut self, invocation: Invocation) {
let result = match self.plugins.get_mut(&invocation.plugin) {
Some(plugin) => plugin