Skip to content

Add show cursor boolean #5934

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 4 commits into from
Jul 7, 2025
Merged

Add show cursor boolean #5934

merged 4 commits into from
Jul 7, 2025

Conversation

willmcgugan
Copy link
Member

@willmcgugan willmcgugan commented Jul 7, 2025

Fixes #5928

A recent change to hide the cursor in read-only mode, revealed plenty of edge cases.

  • Restores cursor to read_only mode.
  • Added a show_cursor which applies when read_only==True. Note that show_cursor is ignored when not in read only mode, as being able to make edits without a cursor just seems like sadism.
  • When in read only mode the cursor doesn't blink, to give a subtle indication that you can't insert anything.
  • When in read only mode with show_cursor==False then the cursor keys will scroll the window (i.e. the default behavior for scrollable containers).

Copy link
Contributor

@TomJGooding TomJGooding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for revisiting this. I haven't had chance to test the code yet, but from a quick scan spotted a possible mistake in the docstring.

@willmcgugan willmcgugan merged commit d5ab640 into main Jul 7, 2025
23 checks passed
@willmcgugan willmcgugan deleted the show-cursor branch July 7, 2025 18:54
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.

Cursor removed in read-only TextArea
2 participants