afrim icon indicating copy to clipboard operation
afrim copied to clipboard

Provide a way to clear the `cursor` of the preprocessor

Open pythonbrad opened this issue 5 months ago • 0 comments

Description

Currently, there is no proper way to clear the cursor of preprocessor externally. And to bypass it, I use the following code.

preprocessor.process(/* KeyEvent to trigger the internal clean */)
// or
self.preprocessor.commit("".to_owned());
self.preprocessor.clear_queue();

This code require knowing the internally working who is not good since it can change in the future.

Expected solution

Have a method to clear the preprocessor cursor.

pub fn clear_cursor(&mut self) {
     self.cursor.clear();
}

pythonbrad avatar Sep 11 '24 12:09 pythonbrad