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

Fix #516: Option to fully highlight wrapped-lines #523

Merged
merged 4 commits into from Aug 7, 2020
Merged

Fix #516: Option to fully highlight wrapped-lines #523

merged 4 commits into from Aug 7, 2020

Conversation

ghost
Copy link

@ghost ghost commented Aug 6, 2020

As stated in the title, this will resolve #516, giving the option to fully highlight the wrapped-line under the cursor, or only the single line under the cursor (current behaviour).

This commit resolves the issue while still mantaining the current behaviour.

Changes:
· ReText/__init__.py
    Change default value of highlightCurrentLine to 'disabled'.
· ReText/config.py
    Add a combobox for the line highlighting setting with options:
        - "Disabled": no line highlighting;
        - "Cursor Line": line highlighting till EOL (current behaviour);
        - "Wrapped Line": line highlighting for whole wrapped line.
· ReText/editor.py
    Modify highlightCurrentLine() to achieve the intended behaviour.
ReText/editor.py Outdated Show resolved Hide resolved
ReText/editor.py Outdated Show resolved Hide resolved
ReText/editor.py Show resolved Hide resolved
* ReText/editor.py
    - Remove semicolon.
    - Remove unnecessary selection for option "wrapped-line".
@ghost
Copy link
Author

ghost commented Aug 6, 2020

All done. I was just noticing that in highlightCurrentLine() there are some repeated lines of code regarding the creation of the selection and the setting of background and property of the selection. I think the code could be refactored a bit.
What do you think?

@mitya57
Copy link
Member

mitya57 commented Aug 6, 2020

Yes, feel free to refactor it. If it's not possible to fix the last line case without two selections, feel free to revert the second one.

@ghost ghost marked this pull request as draft August 6, 2020 19:30
- Revert removal of second selection used for wrapped-lines.
- Refactor highlightCurrentLine().
@ghost ghost marked this pull request as ready for review August 6, 2020 20:05
@ghost
Copy link
Author

ghost commented Aug 6, 2020

Done. Reverted to the precedent solution and refactored the function a bit.

@mitya57 mitya57 merged commit 0e065a5 into retext-project:master Aug 7, 2020
@mitya57
Copy link
Member

mitya57 commented Aug 7, 2020

Merged, thanks!

@ghost ghost deleted the highlight-wrapped-lines branch August 14, 2020 15:48
@mitya57 mitya57 mentioned this pull request Jan 17, 2021
5 tasks
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.

Line highlighting does not highlight full line-wrapped lines
1 participant