findnextstr(). Changes to do_int_spell_fix(), findnextstr(),
do_search(), do_research(), do_replace(), and
do_find_bracket(). (DLR)
+ - When saving or changing file positions, be sure not to ignore
+ placewewant. Changes to do_int_spell_fix(), findnextstr(),
+ do_replace_loop(), and do_replace(). (DLR)
- files.c:
do_insertfile()
- Readd the NANO_SMALL #ifdef around the start_again: label to
the search prompt to the "Go To Line" prompt, since the
toggling works both ways now and non-numeric text shouldn't be
lost when going only one of those ways. (DLR)
+ findnextstr()
+ - Take the no_sameline parameter after can_display_wrap and
+ wholewords, not after all other parameters. (DLR)
+ - Maintain current_y's value when moving up or down lines so
+ that smooth scrolling works correctly. (DLR)
+ - Fix handling of the wholewords flag so that it works with
+ regular expressions and in conjunction with the no_sameline
+ flag, and add new parameters wrapped (used to return the value
+ of search_last_line) and needle_len (used to return the length
+ of the match). (DLR)
do_replace_loop()
- Miscellaneous cleanups: set current to real_current and
current_x to current_x_save, only turn the mark off and call
replacing only marked text when the mark is on. (DLR,
suggested by Joseph Birthisel)
- Return ssize_t instead of int. (DLR)
- findnextstr()
- - Take the no_sameline parameter after can_display_wrap and
- wholewords, not after all other parameters. (DLR)
- - Maintain current_y's value when moving up or down lines so
- that smooth scrolling works correctly. (DLR)
- - Fix handling of the wholewords flag so that it works with
- regular expressions and in conjunction with the no_sameline
- flag, and add new parameters wrapped (used to return the value
- of search_last_line) and needle_len (used to return the length
- of the match). (DLR)
- utils.c:
regexp_bol_or_eol()
- Don't assume any longer that string will be found if
{
char *save_search;
char *save_replace;
- size_t current_x_save = current_x;
+ size_t current_x_save = current_x, pww_save = placewewant;
filestruct *edittop_save = edittop;
filestruct *current_save = current;
/* Save where we are. */
edittop = fileage;
current = fileage;
current_x = -1;
+ placewewant = 0;
/* Find the first whole-word occurrence of word. */
while (findnextstr(TRUE, TRUE, FALSE, fileage, 0, word, NULL,
edittop = edittop_save;
current = current_save;
current_x = current_x_save;
+ placewewant = pww_save;
/* Restore case sensitivity setting. */
if (!case_sens_set)
current = fileptr;
current_x = current_x_find;
current_y = current_y_find;
+ placewewant = xplustabs();
/* needle_len holds the length of needle. */
if (needle_len != NULL)
#endif
if (!replaceall) {
- placewewant = xplustabs();
edit_redraw(current_save, old_pww);
old_pww = placewewant;
}
{
int i;
filestruct *edittop_save, *begin;
- size_t beginx;
+ size_t beginx, pww_save;
ssize_t numreplaced;
if (ISSET(VIEW_MODE)) {
edittop_save = edittop;
begin = current;
beginx = current_x;
+ pww_save = placewewant;
numreplaced = do_replace_loop(last_search, begin, &beginx, FALSE);
edittop = edittop_save;
current = begin;
current_x = beginx;
+ placewewant = pww_save;
renumber_all();
edit_refresh();