From 625135874694da65e2f37c30bf1e0ea127e6ab9e Mon Sep 17 00:00:00 2001 From: Chris Allegretta Date: Fri, 12 Apr 2013 06:43:06 +0000 Subject: [PATCH] 2013-04-12 Chris Allegretta * src/files.c (do_insertfile): Check for saved cursor position when inserting a file as well. Fixes Savannah bug 38600 reported by Craig Barnes. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4574 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 4 ++++ src/files.c | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 10d88a3c..073e0d3e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-04-12 Chris Allegretta + * src/files.c (do_insertfile): Check for saved cursor position when inserting a + file as well. Fixes Savannah bug 38600 reported by Craig Barnes. + 2013-04-07 Michael Berg * do_cut_text - Fix copying (not cutting) text setting Modified state. Fixes issue reported by Benno Schulenberg. diff --git a/src/files.c b/src/files.c index 840695eb..613d912c 100644 --- a/src/files.c +++ b/src/files.c @@ -1195,11 +1195,16 @@ void do_insertfile( #endif #ifdef ENABLE_MULTIBUFFER - if (ISSET(MULTIBUFFER)) + if (ISSET(MULTIBUFFER)) { /* Update the screen to account for the current * buffer. */ + ssize_t savedposline, savedposcol; + display_buffer(); - else + if (!execute && ISSET(POS_HISTORY) + && check_poshistory(answer, &savedposline, &savedposcol)) + do_gotolinecolumn(savedposline, savedposcol, FALSE, FALSE, FALSE, FALSE); + } else #endif { filestruct *top_save = openfile->fileage; @@ -3195,7 +3200,7 @@ void load_poshistory(void) if (hist == NULL) { if (errno != ENOENT) { /* Don't save history when we quit. */ - UNSET(HISTORYLOG); + UNSET(POS_HISTORY); history_error(N_("Error reading %s: %s"), nanohist, strerror(errno)); } -- 2.39.5