Ticket #3390 (closed defect: fixed)
Alt+Backspace on one-letter word erases too much
Reported by: | egmont | Owned by: | andrew_b |
---|---|---|---|
Priority: | minor | Milestone: | 4.8.14 |
Component: | mc-core | Version: | master |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Branch state: | merged | Votes for changeset: | committed-master |
Description
Either on the command line, or in any other text entry field (e.g. copy file to) enter a string where the last word consists of one single letter only. E.g. "abc de f".
Press Alt+Backspace.
Expected behavior: Remove the last word, that is, the letter "f" only, leaving "abc de ".
Actual behavior: Yet another word is removed, leaving "abc ".
Attachments
Change History
Changed 10 years ago by egmont
- Attachment mc-3390-backward-word-off-by-1.patch added
comment:1 follow-up: ↓ 3 Changed 10 years ago by egmont
Here's the fix.
I'm not sure about the intent of that "for" loop, the rest (the two "while" loops later) does the job perfectly. The only thing I can think of is removing trailing '\0' characters, if any. For that purpose, it was off by one, looking at the wrong character, always removing the last one.
comment:3 in reply to: ↑ 1 Changed 10 years ago by andrew_b
- Owner set to andrew_b
- Status changed from new to accepted
- Branch state changed from no branch to on review
- Milestone changed from Future Releases to 4.8.14
Replying to egmont:
I'm not sure about the intent of that "for" loop, the rest (the two "while" loops later) does the job perfectly.
I agree that that loop can be removed.
Branch: 3390_input_backward_word
changeset:ecf4b113d874acf35d3279cc4568798dd493fc85
comment:4 Changed 10 years ago by slavazanko
- Votes for changeset set to slavazanko
- Branch state changed from on review to approved
comment:5 Changed 10 years ago by andrew_b
- Status changed from accepted to testing
- Votes for changeset changed from slavazanko to committed-master
- Resolution set to fixed
- Branch state changed from approved to merged
Merged to master: [96699b7ebaffbee6aac0e061fa33c7b129db5ae8].
Fix