Skip to content

improv: code clarity and fixed console selections. #2222

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

Merged
merged 2 commits into from
May 1, 2025

Conversation

paxcut
Copy link
Collaborator

@paxcut paxcut commented Apr 30, 2025

The function SetSelection() in the text editor is used as its name implies to set the part of text that will be shown highlighted as a selection. It has two parameter for the selection start and end. Strangely it also uses a third argument to choose one of 3 selection modes namely line, word and normal. This is strange because it seems that if one wanted to select a line one would simply choose the line start and end as the selection values. As evidence of its strangeness it creates a bug when the word end is selected twice and another when SetSelection is used to set the cursor when the window acquires focus breaking selections in the console.

This PR simply eliminates the extraneous argument to SetSelection() ensuring that any problems related to it are fixed once and for all.

paxcut added 2 commits April 30, 2025 15:40
The function SetSelection() in the text editor is used as its name implies to set the part of text that will be shown highlighted as a selection. It has two parameter for the selection start and end. Strangely it also uses a third argument to choose one of 3 selection modes namely line, word and normal. This is strange because it seems that if one wanted to select a line one would simply choose the line start and end as the selection values. As evidence of its strangeness it creates a bug when the word end is selected twice and another when SetSelection is used to set the cursor when the window acquires focus breaking selections in the console.

This PR simply eliminates the extraneous argument to SetSelection() ensuring that any problems related to it are fixed once and for all.
…before when it used SetSelection in word mode instead of returning invalid selections when hovering non-word characters.
@paxcut paxcut merged commit 78ad0d2 into WerWolv:master May 1, 2025
18 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant