mirror of
git://git.sv.gnu.org/nano.git
synced 2025-01-14 13:29:37 +03:00
tweaks: frob some whitespace, and rewrap a line
This commit is contained in:
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);
|
||||
/* We use (COLS / 3) here because we need to see more on the line. */
|
||||
sprintf(thedefault, " [%s%s]", disp,
|
||||
(breadth(last_search) > COLS / 3) ? "..." : "");
|
||||
(breadth(last_search) > COLS / 3) ? "..." : "");
|
||||
free(disp);
|
||||
} else
|
||||
thedefault = copy_of("");
|
||||
@ -431,7 +431,7 @@ void go_looking(void)
|
||||
/* If we found something, and we're back at the exact same spot
|
||||
* where we started searching, then this is the only occurrence. */
|
||||
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"));
|
||||
else if (didfind == 0)
|
||||
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
|
||||
* subexpression match to the new line. */
|
||||
if (create) {
|
||||
strncpy(string, openfile->current->data +
|
||||
regmatches[num].rm_so, i);
|
||||
strncpy(string, openfile->current->data + regmatches[num].rm_so, i);
|
||||
string += i;
|
||||
}
|
||||
}
|
||||
@ -704,8 +703,8 @@ void ask_for_and_do_replacements(void)
|
||||
size_t begin_x = openfile->current_x;
|
||||
ssize_t numreplaced;
|
||||
int response = do_prompt(MREPLACEWITH, "", &replace_history,
|
||||
/* TRANSLATORS: This is a prompt. */
|
||||
edit_refresh, _("Replace with"));
|
||||
/* TRANSLATORS: This is a prompt. */
|
||||
edit_refresh, _("Replace with"));
|
||||
|
||||
#ifdef ENABLE_HISTORIES
|
||||
/* 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)
|
||||
statusline(REMARK, P_("Replaced %zd occurrence",
|
||||
"Replaced %zd occurrences", numreplaced), numreplaced);
|
||||
"Replaced %zd occurrences", numreplaced), numreplaced);
|
||||
}
|
||||
|
||||
/* Go to the specified line and x position. */
|
||||
|
Loading…
Reference in New Issue
Block a user