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

Backspace doesn't delete selection if selected beyond TextEdit #60866

Closed
KoBeWi opened this issue May 7, 2022 · 1 comment · Fixed by #60890
Closed

Backspace doesn't delete selection if selected beyond TextEdit #60866

KoBeWi opened this issue May 7, 2022 · 1 comment · Fixed by #60890

Comments

@KoBeWi
Copy link
Member

KoBeWi commented May 7, 2022

Godot version

5636903

System information

Windows 10 x64

Issue description

When you select text in TextEdit, particularly from right to left, with cursor finishing beyond the TextEdit, Backspace has no effect:
godot windows tools 64_Q0rDBbSbKf

Steps to reproduce

  1. Have TextEdit (Button text in the inspector or script editor)
  2. Type any text
  3. Select everything by dragging mouse over the text and waaay to the left
  4. Press Backspace

Minimal reproduction project

No response

@pfertyk
Copy link
Contributor

pfertyk commented May 8, 2022

I'd like to submit a fix.

The code checked if the beginning of the text was reached (line == 0 and column == 0). If so, it didn't remove the text. This resulted in any selection from right to left (that extended to the beginning of the text) to not work with backspace. The selection didn't have to go beyond the frame of the TextEdit, just to the beginning of the first word (worked both with mouse drag and with Shift + left arrow).

Selecting the text from left to right worked fine, because the caret was placed at the end of the text, not the beginning, so the condition was not met.

I've added another part to the condition, checking if there is a selection available ;)

pfertyk added a commit to pfertyk/godot that referenced this issue May 9, 2022
Repository owner moved this from Todo to Done in 4.x Priority Issues May 9, 2022
DarkMessiah pushed a commit to DarkMessiah/godot that referenced this issue May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants