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

Provide a way to clear the cursor of the preprocessor #259

Open
pythonbrad opened this issue Sep 11, 2024 · 0 comments
Open

Provide a way to clear the cursor of the preprocessor #259

pythonbrad opened this issue Sep 11, 2024 · 0 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@pythonbrad
Copy link
Member

pythonbrad commented Sep 11, 2024

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 pythonbrad self-assigned this Sep 11, 2024
@pythonbrad pythonbrad added the good first issue Good for newcomers label Sep 11, 2024
@pythonbrad pythonbrad changed the title Provide a way to clear the text_buffer of the preprocessor Provide a way to clear the cursor of the preprocessor Sep 11, 2024
@pythonbrad pythonbrad assigned pythonbrad and unassigned pythonbrad Sep 11, 2024
@pythonbrad pythonbrad added good first issue Good for newcomers and removed good first issue Good for newcomers labels Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant