Commit 1929982e authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

in do_insertfile(), when inserting a file in non-multibuffer mode,

preserve placewewant as well as current_x, for compatibility with Pico


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1982 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 7 additions and 2 deletions
+7 -2
...@@ -84,6 +84,9 @@ CVS code - ...@@ -84,6 +84,9 @@ CVS code -
cursor position at the statusbar is reset. (DLR) cursor position at the statusbar is reset. (DLR)
- Add missing #ifdefs around the wrap_reset() call so that nano - Add missing #ifdefs around the wrap_reset() call so that nano
compiles with wrapping disabled again. (DLR) compiles with wrapping disabled again. (DLR)
- When inserting a file in non-multibuffer mode, preserve
placewewant as well as current_x, for compatibility with
Pico. (DLR)
do_writeout() do_writeout()
- Restructure if blocks for greater efficiency, using - Restructure if blocks for greater efficiency, using
do_insertfile() as a model. (DLR) do_insertfile() as a model. (DLR)
......
...@@ -540,7 +540,8 @@ void do_insertfile( ...@@ -540,7 +540,8 @@ void do_insertfile(
statusbar(_("Cancelled")); statusbar(_("Cancelled"));
break; break;
} else { } else {
int old_current_x = current_x; size_t old_current_x = current_x;
size_t old_pww = placewewant;
ans = mallocstrcpy(ans, answer); ans = mallocstrcpy(ans, answer);
...@@ -596,8 +597,9 @@ void do_insertfile( ...@@ -596,8 +597,9 @@ void do_insertfile(
/* Mark the file as modified. */ /* Mark the file as modified. */
set_modified(); set_modified();
/* Restore the old x-coordinate position. */ /* Restore the old cursor position. */
current_x = old_current_x; current_x = old_current_x;
placewewant = old_pww;
#ifdef ENABLE_MULTIBUFFER #ifdef ENABLE_MULTIBUFFER
} }
#endif #endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment