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

Add TextEdit unit tests and multiple fixes. #60438

Merged
merged 3 commits into from
Apr 25, 2022

Conversation

Paulb23
Copy link
Member

@Paulb23 Paulb23 commented Apr 22, 2022

This PR adds the initial TextEdit unit tests, similar to that of CodeEdit, can start adding as we go from here.

Testing some functionality required the use of the Input singleton, however, it was not nulling itself on delete, this has been fixed.

In addition to this, expanded test macros for mouse interaction so it's now possible to test use cases such as shift+left click and dragging. With the Input singleton now existing, aligned key actions to use push_input rather then directly calling gui_input.

Otherwise, found and fixed the following in TextEdit:

  • Fixed line_drawing_cache not containing anything
  • Fixed is_move_caret_on_right_click_enabled requiring the context menu to be enabled
  • Fixed when selecting_enabled is false not disabling shift + click
  • Fixed when selecting_enabled is false not being able to drag the caret
  • Fixed _delete emitting signals when nothing had changed.
  • Fixed insert_line_at up not causing a visual update
  • Fixed get_pos_at_line_column returning a valid position when it was invalid
  • Fixed set_caret_column unnecessary emitting "caret_changed" when the column is greater then the line
  • Fixed select_word_under_caret not accepting the edges of words
  • Fixed select_word_under_caret moving the caret to the start of the line when no word was found
  • Fixed get_selection_line and get_selection_column not checking if the selection was enabled
  • Fixed set_line_as_center_visible throwing errors if it would show line 0
  • Fixed set_line_as_center_visible being off by one
  • Fixed set_line_as_last_visible not being able to show the first line
  • Fixed pressing KEY_UP and the end of a wrapped line sending the caret to col 0 rather then persevering the position.

And a small _move_caret_to_line_start refactor for getting the first non-whitespaced column.

Fixed line_drawing_cache not containing anything
Fixed is_move_caret_on_right_click_enabled requiring the context menu to be enabled
Fixed when selecting_enabled is false not disabling shift + click
Fixed when selecting_enabled is false not being able to drag the caret
Fixed _delete emitting signals when nothing had changed.
Fixed insert_line_at up causing a visual update
Fixed get_pos_at_line_column returning a valid position when it was invalid
Fixed set_caret_column unnecessary emitting "caret_changed" when the column is greater then the line
Fixed select_word_under_caret not accepting the edges of words
Fixed select_word_under_caret moving the caret to the start of the line when no word was found
Fixed get_selection_line and get_selection_column not checking if the selection was enabled
Fixed set_line_as_center_visible throwing errors if it would show line 0
Fixed set_line_as_center_visible being off by one
Fixed set_line_as_last_visible not being able to show the first line
Fixed pressing UP and the end of a wrapped line sending the caret to col 0 rather then then persevering the position.
@akien-mga akien-mga merged commit 8c2b980 into godotengine:master Apr 25, 2022
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants