tweaks: frob some whitespace, and rewrap a line
parent
088557c516
commit
44fb3e9991
13
src/search.c
13
src/search.c
|
@ -82,7 +82,7 @@ void search_init(bool replacing, bool retain_answer)
|
||||||
thedefault = nmalloc(strlen(disp) + 7);
|
thedefault = nmalloc(strlen(disp) + 7);
|
||||||
/* We use (COLS / 3) here because we need to see more on the line. */
|
/* We use (COLS / 3) here because we need to see more on the line. */
|
||||||
sprintf(thedefault, " [%s%s]", disp,
|
sprintf(thedefault, " [%s%s]", disp,
|
||||||
(breadth(last_search) > COLS / 3) ? "..." : "");
|
(breadth(last_search) > COLS / 3) ? "..." : "");
|
||||||
free(disp);
|
free(disp);
|
||||||
} else
|
} else
|
||||||
thedefault = copy_of("");
|
thedefault = copy_of("");
|
||||||
|
@ -431,7 +431,7 @@ void go_looking(void)
|
||||||
/* If we found something, and we're back at the exact same spot
|
/* If we found something, and we're back at the exact same spot
|
||||||
* where we started searching, then this is the only occurrence. */
|
* where we started searching, then this is the only occurrence. */
|
||||||
if (didfind == 1 && openfile->current == was_current &&
|
if (didfind == 1 && openfile->current == was_current &&
|
||||||
openfile->current_x == was_current_x)
|
openfile->current_x == was_current_x)
|
||||||
statusline(REMARK, _("This is the only occurrence"));
|
statusline(REMARK, _("This is the only occurrence"));
|
||||||
else if (didfind == 0)
|
else if (didfind == 0)
|
||||||
not_found_msg(last_search);
|
not_found_msg(last_search);
|
||||||
|
@ -473,8 +473,7 @@ int replace_regexp(char *string, bool create)
|
||||||
/* And if create is TRUE, append the result of the
|
/* And if create is TRUE, append the result of the
|
||||||
* subexpression match to the new line. */
|
* subexpression match to the new line. */
|
||||||
if (create) {
|
if (create) {
|
||||||
strncpy(string, openfile->current->data +
|
strncpy(string, openfile->current->data + regmatches[num].rm_so, i);
|
||||||
regmatches[num].rm_so, i);
|
|
||||||
string += i;
|
string += i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -704,8 +703,8 @@ void ask_for_and_do_replacements(void)
|
||||||
size_t begin_x = openfile->current_x;
|
size_t begin_x = openfile->current_x;
|
||||||
ssize_t numreplaced;
|
ssize_t numreplaced;
|
||||||
int response = do_prompt(MREPLACEWITH, "", &replace_history,
|
int response = do_prompt(MREPLACEWITH, "", &replace_history,
|
||||||
/* TRANSLATORS: This is a prompt. */
|
/* TRANSLATORS: This is a prompt. */
|
||||||
edit_refresh, _("Replace with"));
|
edit_refresh, _("Replace with"));
|
||||||
|
|
||||||
#ifdef ENABLE_HISTORIES
|
#ifdef ENABLE_HISTORIES
|
||||||
/* When not "", add the replace string to the replace history list. */
|
/* When not "", add the replace string to the replace history list. */
|
||||||
|
@ -732,7 +731,7 @@ void ask_for_and_do_replacements(void)
|
||||||
|
|
||||||
if (numreplaced >= 0)
|
if (numreplaced >= 0)
|
||||||
statusline(REMARK, P_("Replaced %zd occurrence",
|
statusline(REMARK, P_("Replaced %zd occurrence",
|
||||||
"Replaced %zd occurrences", numreplaced), numreplaced);
|
"Replaced %zd occurrences", numreplaced), numreplaced);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Go to the specified line and x position. */
|
/* Go to the specified line and x position. */
|
||||||
|
|
Loading…
Reference in New Issue