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

Alt+Backspace on one-letter word erases too much #3390

Closed
mc-butler opened this issue Jan 20, 2015 · 7 comments
Closed

Alt+Backspace on one-letter word erases too much #3390

mc-butler opened this issue Jan 20, 2015 · 7 comments
Assignees
Labels
area: core Issues not related to a specific subsystem prio: low Minor problem or easily worked around
Milestone

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/3390
Reporter egmont (@egmontkob)

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 ".

Note

Original attachments:

@mc-butler
Copy link
Author

Changed by egmont (@egmontkob) on Jan 20, 2015 at 19:01 UTC

Fix

@mc-butler
Copy link
Author

Changed by egmont (@egmontkob) on Jan 20, 2015 at 19:03 UTC (comment 1)

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.

@mc-butler
Copy link
Author

Changed by egmont (@egmontkob) on Jan 20, 2015 at 19:06 UTC (comment 2)

Note: Same story for Ctrl+Left.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jan 21, 2015 at 7:43 UTC (comment 1.3)

  • Owner set to andrew_b
  • Milestone changed from Future Releases to 4.8.14
  • Status changed from new to accepted
  • Branch state changed from no branch to on review

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
[ecf4b113d874acf35d3279cc4568798dd493fc85]

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Feb 19, 2015 at 9:17 UTC (comment 4)

  • Votes set to slavazanko
  • Branch state changed from on review to approved

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Feb 20, 2015 at 6:15 UTC (comment 5)

  • Status changed from accepted to testing
  • Resolution set to fixed
  • Votes changed from slavazanko to committed-master
  • Branch state changed from approved to merged

Merged to master: [96699b7].

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Feb 20, 2015 at 6:16 UTC (comment 6)

  • Status changed from testing to closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: core Issues not related to a specific subsystem prio: low Minor problem or easily worked around
Development

No branches or pull requests

2 participants