cutting: do nothing when trying to chop a word leftward at start of file

Instead of marking the buffer as modified, provide the feedback that
"nothing was cut", like when trying to chop a word rightward at the
end of the buffer.

This fixes https://savannah.gnu.org/bugs/?57015.

Bug existed since version 4.4, commit 4314b8de.
master
Benno Schulenberg 2019-10-07 17:18:45 +02:00
parent f813fd0f4d
commit 53d4224be9
1 changed files with 4 additions and 1 deletions

View File

@ -194,7 +194,10 @@ void chop_word(bool forward)
/* Delete a word leftward. */
void chop_previous_word(void)
{
chop_word(BACKWARD);
if (openfile->current->prev == NULL && openfile->current_x == 0)
statusbar(_("Nothing was cut"));
else
chop_word(BACKWARD);
}
/* Delete a word rightward. */