mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-22 12:51:23 +03:00
tweaks: rename two variables, to match others
Also, initialize them straightaway.
This commit is contained in:
parent
408f15954e
commit
b9581bd50a
15
src/search.c
15
src/search.c
@ -922,8 +922,9 @@ bool find_bracket_match(bool reverse, const char *bracket_set)
|
||||
* there is one. */
|
||||
void do_find_bracket(void)
|
||||
{
|
||||
linestruct *current_save;
|
||||
size_t current_x_save;
|
||||
linestruct *was_current = openfile->current;
|
||||
size_t was_current_x = openfile->current_x;
|
||||
/* The current cursor position, in case we don't find a complement. */
|
||||
const char *ch;
|
||||
/* The location in matchbrackets of the bracket under the cursor. */
|
||||
int ch_len;
|
||||
@ -950,10 +951,6 @@ void do_find_bracket(void)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Remember the current position in case we don't find a complement. */
|
||||
current_save = openfile->current;
|
||||
current_x_save = openfile->current_x;
|
||||
|
||||
/* Find the halfway point in matchbrackets, where the closing ones start. */
|
||||
for (size_t i = 0; i < charcount; i++)
|
||||
halfway += parse_mbchar(matchbrackets + halfway, NULL, NULL);
|
||||
@ -991,15 +988,15 @@ void do_find_bracket(void)
|
||||
/* If balance is zero, we've found a matching bracket. Update
|
||||
* the screen and get out. */
|
||||
if (balance == 0) {
|
||||
edit_redraw(current_save, FLOWING);
|
||||
edit_redraw(was_current, FLOWING);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
/* We didn't find either an opening or closing bracket.
|
||||
* Indicate this, restore where we were, and get out. */
|
||||
statusbar(_("No matching bracket"));
|
||||
openfile->current = current_save;
|
||||
openfile->current_x = current_x_save;
|
||||
openfile->current = was_current;
|
||||
openfile->current_x = was_current_x;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user