From 9c2b67231e888416092a0f4b4b87d269a5df651c Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 30 Sep 2018 13:27:08 +0200 Subject: [PATCH] tweaks: rename a flag, to match the name of the option --- src/files.c | 4 ++-- src/history.c | 2 +- src/nano.c | 14 +++++++------- src/nano.h | 2 +- src/rcfile.c | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/files.c b/src/files.c index 6e39a59f..37581863 100644 --- a/src/files.c +++ b/src/files.c @@ -687,7 +687,7 @@ bool close_buffer(void) return FALSE; #ifdef ENABLE_HISTORIES - if (ISSET(POS_HISTORY)) + if (ISSET(POSITIONLOG)) update_poshistory(openfile->filename, openfile->current->lineno, xplustabs() + 1); #endif @@ -1221,7 +1221,7 @@ void do_insertfile(void) #ifdef ENABLE_MULTIBUFFER if (ISSET(MULTIBUFFER)) { #ifdef ENABLE_HISTORIES - if (ISSET(POS_HISTORY)) { + if (ISSET(POSITIONLOG)) { ssize_t priorline, priorcol; #ifndef NANO_TINY if (!execute) diff --git a/src/history.c b/src/history.c index 5668038f..b3530837 100644 --- a/src/history.c +++ b/src/history.c @@ -403,7 +403,7 @@ void load_poshistory(void) if (hisfile == NULL) { if (errno != ENOENT) { /* When reading failed, don't save history when we quit. */ - UNSET(POS_HISTORY); + UNSET(POSITIONLOG); history_error(N_("Error reading %s: %s"), poshistname, strerror(errno)); } } else { diff --git a/src/nano.c b/src/nano.c index 7f0e18a8..48a0459c 100644 --- a/src/nano.c +++ b/src/nano.c @@ -584,7 +584,7 @@ void finish(void) /* If the user wants history persistence, write the relevant files. */ if (ISSET(HISTORYLOG)) save_history(); - if (ISSET(POS_HISTORY)) { + if (ISSET(POSITIONLOG)) { update_poshistory(openfile->filename, openfile->current->lineno, xplustabs() + 1); } #endif @@ -2152,7 +2152,7 @@ int main(int argc, char **argv) break; #ifdef ENABLE_HISTORIES case 'P': - SET(POS_HISTORY); + SET(POSITIONLOG); break; #endif #ifdef ENABLE_JUSTIFY @@ -2427,7 +2427,7 @@ int main(int argc, char **argv) UNSET(SUSPEND); #ifdef ENABLE_NANORC UNSET(HISTORYLOG); - UNSET(POS_HISTORY); + UNSET(POSITIONLOG); #endif } @@ -2437,15 +2437,15 @@ int main(int argc, char **argv) /* If we need history files, verify that we have a directory for them, * and when not, cancel the options. */ - if ((ISSET(HISTORYLOG) || ISSET(POS_HISTORY)) && !have_statedir()) { + if ((ISSET(HISTORYLOG) || ISSET(POSITIONLOG)) && !have_statedir()) { UNSET(HISTORYLOG); - UNSET(POS_HISTORY); + UNSET(POSITIONLOG); } /* If the user wants history persistence, read the relevant files. */ if (ISSET(HISTORYLOG)) load_history(); - if (ISSET(POS_HISTORY)) + if (ISSET(POSITIONLOG)) load_poshistory(); #endif /* ENABLE_HISTORIES */ @@ -2631,7 +2631,7 @@ int main(int argc, char **argv) if (givenline != 0 || givencol != 0) do_gotolinecolumn(givenline, givencol, FALSE, FALSE); #ifdef ENABLE_HISTORIES - else if (ISSET(POS_HISTORY) && openfile->filename[0] != '\0') { + else if (ISSET(POSITIONLOG) && openfile->filename[0] != '\0') { ssize_t savedline, savedcol; /* If edited before, restore the last cursor position. */ if (has_old_position(argv[optind - 1], &savedline, &savedcol)) diff --git a/src/nano.h b/src/nano.h index 7de34bf3..3beffe43 100644 --- a/src/nano.h +++ b/src/nano.h @@ -531,7 +531,7 @@ enum BOLD_TEXT, QUIET, SOFTWRAP, - POS_HISTORY, + POSITIONLOG, LOCKING, NOREAD_MODE, MAKE_IT_UNIX, diff --git a/src/rcfile.c b/src/rcfile.c index 75f085f0..e0b68c1f 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -69,7 +69,7 @@ static const rcoption rcopts[] = { {"operatingdir", 0}, #endif #ifdef ENABLE_HISTORIES - {"positionlog", POS_HISTORY}, + {"positionlog", POSITIONLOG}, #endif {"preserve", PRESERVE}, #ifdef ENABLE_JUSTIFY