diff --git a/ChangeLog b/ChangeLog index f2b8da47800e6cfd01b42cf9f06d6c103218c99b..25b33e390745378643e13a151928ef9d9705fc80 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,10 @@ CVS code - shortcut list, and tweak the unjustify routine to use it. (DLR) - files.c: + add_open_files() + - Make the saving of marked status in open_files->file_flags + work properly again; a tweak to the ISSET() macro in 1.3.0 + to make it only return 0 or 1 broke it. (DLR) write_marked() - New function used to write the current marked selection to a file, split out from do_writeout(). (DLR) @@ -361,8 +365,8 @@ GNU nano 1.3.0 - 2003.10.22 interpreted as Ctrl-[character], and the support for Pico's Esc Esc [three-digit decimal ASCII code] input method. (DLR) do_mark() - - Toggle MARK_ISSET() at the beginning of the function instead - of setting it in one place and unsetting it in another place. + - Toggle MARK_ISSET at the beginning of the function instead of + setting it in one place and unsetting it in another place. (David Benbennick) do_suspend() - Use handle_hupterm() to handle SIGHUP and SIGTERM so we can diff --git a/src/files.c b/src/files.c index 2bcff96ab3bf593df453d122b3c62f6d874fc33c..8c6d7ea838f2a519b10215e76c00b525660a2677 100644 --- a/src/files.c +++ b/src/files.c @@ -777,17 +777,24 @@ int add_open_file(int update) /* save current line number */ open_files->file_lineno = current->lineno; + /* start with default modification status: unmodified (and marking + status, if available: unmarked) */ + open_files->file_flags = 0; + /* if we're updating, save current modification status (and marking status, if available) */ if (update) { #ifndef NANO_SMALL - open_files->file_flags = (MODIFIED & ISSET(MODIFIED)) | (MARK_ISSET & ISSET(MARK_ISSET)); + if (ISSET(MODIFIED)) + open_files->file_flags |= MODIFIED; if (ISSET(MARK_ISSET)) { open_files->file_mark_beginbuf = mark_beginbuf; open_files->file_mark_beginx = mark_beginx; + open_files->file_flags |= MARK_ISSET; } #else - open_files->file_flags = (MODIFIED & ISSET(MODIFIED)); + if (ISSET(MODIFIED)) + open_files->file_flags |= MODIFIED; #endif }