+2015-03-28 Benno Schulenberg <bensberg@justemail.net>
+ * src/search.c (search_init_globals, search_replace_abort),
+ src/winio.c (edit_redraw), src/proto.h, src/global.c: When finding
+ an off-screen string, put it on the center line of the screen and
+ not on the bottom or top line. This restores the old behaviour
+ that was unintentionally changed in r5149 six days ago.
+
2015-03-27 Mark Majeres <mark@engine12.com>
* src/text.c (do_alt_speller): Adjust the end point of the marked
region for any change in length of the region's last line.
/* Whether the current keystroke is a Meta key. */
bool func_key;
/* Whether the current keystroke is an extended keypad value. */
+bool focusing = FALSE;
+ /* Whether an update of the edit window should center the cursor. */
#ifndef DISABLE_WRAPJUSTIFY
ssize_t fill = 0;
extern bool meta_key;
extern bool func_key;
+extern bool focusing;
#ifndef DISABLE_WRAPJUSTIFY
extern ssize_t fill;
void search_replace_abort(void)
{
display_main_list();
+ focusing = FALSE;
#ifndef NANO_TINY
if (openfile->mark_set)
edit_refresh();
/* Initialize the global search and replace strings. */
void search_init_globals(void)
{
+ focusing = TRUE;
if (last_search == NULL)
last_search = mallocstrcpy(NULL, "");
if (last_replace == NULL)
#endif /* !NANO_TINY */
/* Make sure the current line is on the screen. */
- if (ISSET(SMOOTH_SCROLL))
- edit_update(NONE);
- else
- edit_update(CENTER);
+ edit_update((ISSET(SMOOTH_SCROLL) && !focusing) ? NONE : CENTER);
/* Update old_current if we're not on the same page as
* before. */