diff --git a/ChangeLog b/ChangeLog index 090d252f7a445f4a74286add7668d72fd3126e7c..0753c28005feaa82db5c6be4268da397aeb54001 100644 --- a/ChangeLog +++ b/ChangeLog @@ -84,6 +84,9 @@ CVS code - cursor position at the statusbar is reset. (DLR) - Add missing #ifdefs around the wrap_reset() call so that nano 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() - Restructure if blocks for greater efficiency, using do_insertfile() as a model. (DLR) diff --git a/src/files.c b/src/files.c index 376b34ac3b7a64cd1ada2ec710f63d1d68f3df94..2ffdeb718f2ebe08216211187b56af293fc71a81 100644 --- a/src/files.c +++ b/src/files.c @@ -540,7 +540,8 @@ void do_insertfile( statusbar(_("Cancelled")); break; } else { - int old_current_x = current_x; + size_t old_current_x = current_x; + size_t old_pww = placewewant; ans = mallocstrcpy(ans, answer); @@ -596,8 +597,9 @@ void do_insertfile( /* Mark the file as modified. */ set_modified(); - /* Restore the old x-coordinate position. */ + /* Restore the old cursor position. */ current_x = old_current_x; + placewewant = old_pww; #ifdef ENABLE_MULTIBUFFER } #endif