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

Ctrl + arrow support in names #5203

Closed
DorpsGek opened this issue Jun 4, 2012 · 6 comments
Closed

Ctrl + arrow support in names #5203

DorpsGek opened this issue Jun 4, 2012 · 6 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

DorpsGek commented Jun 4, 2012

CoDial opened the ticket and wrote:

^left arrow and ^right arrow are not supported in names edition field. It should behave the same way it behaves in Windows so ^left arrow should move caret to prev. word, whiled ^right should move caret to next word.

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/5203
@DorpsGek
Copy link
Member Author

DorpsGek commented Sep 4, 2012

sbr wrote:

Add word by word caret move capability to Textbuf when pressing Ctrl+Left/Right.

Please find attached a patch against r24510.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/5203#comment11493

@DorpsGek
Copy link
Member Author

DorpsGek commented Sep 9, 2012

Zuu wrote:

I've modified your patch so that it is now more clear that it unconditionally removes the first char no matter if it is a white space or not. In your patch it could unconditionally remove a non-white space by the white space code. This is only a matter of clarity. Your original code provided the same behaviour.

This is found in ctrl-arrow-v2-r24516.patch

Additionally I've implemented Ctrl+Backspace and Ctrl+Delete in a separate patch that applies after the patch above. (they are fairly independent but are made in a patch queue so that arrow keys are placed first and may conflict slightly if applied in the reverse order)

This is found in ctrl-backspace-delete-v2-r24516.patch

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/5203#comment11503

@DorpsGek
Copy link
Member Author

DorpsGek commented Sep 9, 2012

Zuu wrote:

The patches have been improved after feedback on IRC. I've now split the code change apart from the added features:

Patches:
http://devs.openttd.org/~zuu/text-edit/


This comment was imported from FlySpray: https://bugs.openttd.org/task/5203#comment11504

@DorpsGek
Copy link
Member Author

sbr wrote:

('s/to/too' in re-open request)

When moving caret by word, the character is tested at the caret position. A first move is then needed to decide what to do with this character.
Also when moving left, start of word is detected when the caret is before the word. A right move replace it at the start of the word.

But when removing by word, the first next char shouldn't be removed without testing it:
{Ctrl+Del, caret pos = 0, ' WORD'} should give 'WORD', not ''
{Ctrl+Backspace, caret pos = 6 (end of string), 'WORD W'} should give 'WORD ', not ''

Please find attached a patch against r24521.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/5203#comment11505

@DorpsGek
Copy link
Member Author

sbr wrote:

Ctrl+Del & Ctrl+Backspace can remove to many characters.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5203#comment11514

@DorpsGek
Copy link
Member Author

Zuu closed the ticket.

Reason for closing: Fixed

In r24530


This comment was imported from FlySpray: https://bugs.openttd.org/task/5203

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant