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

UICatalog Text Editor Column / Row not be updated when cursor moving #2739

Closed
qzhan16 opened this issue Jul 10, 2023 · 2 comments · Fixed by #2740
Closed

UICatalog Text Editor Column / Row not be updated when cursor moving #2739

qzhan16 opened this issue Jul 10, 2023 · 2 comments · Fixed by #2740

Comments

@qzhan16
Copy link

qzhan16 commented Jul 10, 2023

Describe the bug

Text Editor Column / Row not be updated when cursor moving

To Reproduce

  1. Run the sample "UICatalog", select TextView -> Editor.
  2. move the cursor by keyboard or mouse in the text editor, the column / row was not updated, unless i select some words or i do modification on the text.

Expected behavior
Column / Row should be updated when user move the cursor to provide a better user experience.

is any callback for cursor moving event to replace the UnwrappedCursorPosition?

@qzhan16
Copy link
Author

qzhan16 commented Jul 11, 2023

Actually I found CurrentColumn / CurrentRow has been updated correctly in TextView, and UnwrappedCursorPosition was triggered as expected, but the UI just wasn't refreshed.

@qzhan16
Copy link
Author

qzhan16 commented Jul 11, 2023

I worked around this by calling SetChildNeedsDisplay when UnwrappedCursorPosition event happen, looking for a more elegant solution.

_textView.UnwrappedCursorPosition += (e) => {
	siCursorPosition.Title = $"Ln {e.Y + 1}, Col {e.X + 1}";
+      Win.SetChildNeedsDisplay ();			
};

BDisp added a commit to BDisp/Terminal.Gui that referenced this issue Jul 11, 2023
BDisp added a commit to BDisp/Terminal.Gui that referenced this issue Jul 11, 2023
qzhan15 added a commit to qzhan15/Terminal.Gui that referenced this issue Jul 11, 2023
…when cursor moving

Statusbar will request redraw if any item's Title get changed.
@tig tig closed this as completed in #2740 Jul 12, 2023
tig pushed a commit that referenced this issue Jul 12, 2023
tig pushed a commit that referenced this issue Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant