nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 05334a2b3cba9e94239e35e3b4bae21640e09009
parent 22a01cad9e7746cf93a9367aec5819e539ea0969
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Sun,  7 Feb 2016 12:49:42 +0000

Not recording files that have the default cursor position.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5615 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

Diffstat:
MChangeLog | 4++++
Msrc/files.c | 14++++++++++++++
2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,7 @@ +2016-02-07 Benno Schulenberg <bensberg@justemail.net> + * src/files.c (update_poshistory): Don't put files in the history list + when they have the default cursor position (line 1, column 1). + 2016-02-06 Benno Schulenberg <bensberg@justemail.net> * src/files.c (write_file): Remove the --nofollow option that hasn't been working for a dozen years. diff --git a/src/files.c b/src/files.c @@ -3212,6 +3212,20 @@ void update_poshistory(char *filename, ssize_t lineno, ssize_t xpos) posprev = posptr; } + /* Don't record files that have the default cursor position. */ + if (lineno == 1 && xpos == 1) { + if (posptr != NULL) { + if (posprev == NULL) + position_history = posptr->next; + else + posprev->next = posptr->next; + free(posptr->filename); + free(posptr); + } + free(fullpath); + return; + } + theone = posptr; /* If we didn't find it, make a new node; otherwise, if we're