Normalizing a bit of indentation.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5619 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
836fa7066a
commit
e5fee7e649
|
@ -6,6 +6,7 @@
|
||||||
* src/files.c (write_file): Elide an unneeded 'if'.
|
* src/files.c (write_file): Elide an unneeded 'if'.
|
||||||
* doc/syntax/c.nanorc: Use a character class instead of a literal tab
|
* doc/syntax/c.nanorc: Use a character class instead of a literal tab
|
||||||
and space. The change was inspired by David Niklas.
|
and space. The change was inspired by David Niklas.
|
||||||
|
* src/prompt.c (do_yesno_prompt): Normalize the indentation.
|
||||||
|
|
||||||
2016-02-06 Benno Schulenberg <bensberg@justemail.net>
|
2016-02-06 Benno Schulenberg <bensberg@justemail.net>
|
||||||
* src/files.c (write_file): Remove the --nofollow option that hasn't
|
* src/files.c (write_file): Remove the --nofollow option that hasn't
|
||||||
|
|
53
src/prompt.c
53
src/prompt.c
|
@ -913,46 +913,37 @@ int do_yesno_prompt(bool all, const char *msg)
|
||||||
ok = -1;
|
ok = -1;
|
||||||
#ifndef DISABLE_MOUSE
|
#ifndef DISABLE_MOUSE
|
||||||
else if (kbinput == KEY_MOUSE) {
|
else if (kbinput == KEY_MOUSE) {
|
||||||
/* We can click on the Yes/No/All shortcut list to
|
/* We can click on the Yes/No/All shortcuts to select an answer. */
|
||||||
* select an answer. */
|
if (get_mouseinput(&mouse_x, &mouse_y, FALSE) == 0 &&
|
||||||
if (get_mouseinput(&mouse_x, &mouse_y, FALSE) == 0 &&
|
wmouse_trafo(bottomwin, &mouse_y, &mouse_x, FALSE) &&
|
||||||
wmouse_trafo(bottomwin, &mouse_y, &mouse_x,
|
mouse_x < (width * 2) && mouse_y > 0) {
|
||||||
FALSE) && mouse_x < (width * 2) &&
|
int x = mouse_x / width;
|
||||||
mouse_y > 0) {
|
/* The x-coordinate among the Yes/No/All shortcuts. */
|
||||||
int x = mouse_x / width;
|
int y = mouse_y - 1;
|
||||||
/* Calculate the x-coordinate relative to the
|
/* The y-coordinate among the Yes/No/All shortcuts. */
|
||||||
* two columns of the Yes/No/All shortcuts in
|
|
||||||
* bottomwin. */
|
|
||||||
int y = mouse_y - 1;
|
|
||||||
/* Calculate the y-coordinate relative to the
|
|
||||||
* beginning of the Yes/No/All shortcuts in
|
|
||||||
* bottomwin, i.e. with the sizes of topwin,
|
|
||||||
* edit, and the first line of bottomwin
|
|
||||||
* subtracted out. */
|
|
||||||
|
|
||||||
assert(0 <= x && x <= 1 && 0 <= y && y <= 1);
|
assert(0 <= x && x <= 1 && 0 <= y && y <= 1);
|
||||||
|
|
||||||
/* x == 0 means they clicked Yes or No. y == 0
|
/* x == 0 means they clicked Yes or No.
|
||||||
* means Yes or All. */
|
* y == 0 means Yes or All. */
|
||||||
ok = -2 * x * y + x - y + 1;
|
ok = -2 * x * y + x - y + 1;
|
||||||
|
|
||||||
if (ok == 2 && !all)
|
if (ok == 2 && !all)
|
||||||
ok = -2;
|
ok = -2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* !DISABLE_MOUSE */
|
#endif /* !DISABLE_MOUSE */
|
||||||
else if (func == total_refresh) {
|
else if (func == total_refresh) {
|
||||||
total_redraw();
|
total_redraw();
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
/* Look for the kbinput in the Yes, No and (optionally)
|
/* Look for the kbinput in the Yes, No (and All) strings. */
|
||||||
* All strings. */
|
if (strchr(yesstr, kbinput) != NULL)
|
||||||
if (strchr(yesstr, kbinput) != NULL)
|
ok = 1;
|
||||||
ok = 1;
|
else if (strchr(nostr, kbinput) != NULL)
|
||||||
else if (strchr(nostr, kbinput) != NULL)
|
ok = 0;
|
||||||
ok = 0;
|
else if (all && strchr(allstr, kbinput) != NULL)
|
||||||
else if (all && strchr(allstr, kbinput) != NULL)
|
ok = 2;
|
||||||
ok = 2;
|
|
||||||
}
|
}
|
||||||
} while (ok == -2);
|
} while (ok == -2);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue