[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] [PATCH v2] text: set and reset the Modified state corre

From: Benno Schulenberg
Subject: Re: [Nano-devel] [PATCH v2] text: set and reset the Modified state correctly when undoing/redoing
Date: Tue, 19 Dec 2017 19:19:43 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0

Op 19-12-17 om 18:17 schreef Benno Schulenberg:
+    /* When at the point where the file was last saved, unset "Modified". */
+    if (openfile->current_undo == openfile->last_saved) {

This triggers too often.  For example, run 'src/nano +1 NEWS'
and type:  aaa  ^S  M-U  wwwww  <Enter>  M-U.

With the last M-U the Modified marker disappears, wrongly.  This is
because some part of the undo stack is freed and then apparently the
same piece of memory gets reused for new undo items, giving a false
match for the point at which the file was saved.

An easy solution would be: to not free any undo items when they are
discarded.  That's a bit wasteful memory-wise, but... if no one has
a better idea, that is the solution I propose.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]