text: add auto-whitespace to the file size after creating the undo item
The undo item for ENTER should record the file size *before* the amount of auto-indentation whitespace is added to it. This fixes https://savannah.gnu.org/bugs/?54344. Reported-by: Liu Hao <lh_mouse@126.com>master
parent
d04c8f88f1
commit
c4d09cc24b
|
@ -1050,8 +1050,6 @@ void do_enter(void)
|
|||
/* If there were only blanks before the cursor, trim them. */
|
||||
if (allblanks)
|
||||
openfile->current_x = 0;
|
||||
else
|
||||
openfile->totsize += extra;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1081,6 +1079,8 @@ void do_enter(void)
|
|||
set_modified();
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (ISSET(AUTOINDENT) && !allblanks)
|
||||
openfile->totsize += extra;
|
||||
update_undo(ENTER);
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue