mirror of
https://https.git.savannah.gnu.org/git/nano.git
synced 2026-01-26 16:09:15 +00:00
tweaks: rename two functions, reword some comments, rewrap a line
This commit is contained in:
parent
bd72b21c18
commit
632542462a
@ -1336,11 +1336,11 @@ void unbound_key(int code)
|
||||
}
|
||||
|
||||
#ifdef ENABLE_MOUSE
|
||||
/* Handle a mouse click on the edit window or the shortcut list. */
|
||||
int do_mouse(void)
|
||||
/* Handle a mouse click in the edit window or the help lines. */
|
||||
int process_click(void)
|
||||
{
|
||||
int click_row, click_col;
|
||||
int retval = get_mouseinput(&click_row, &click_col);
|
||||
int retval = get_mouseinput(&click_row, &click_col); /* Handles shortcuts. */
|
||||
|
||||
/* If the click is wrong or already handled, we're done. */
|
||||
if (retval != 0)
|
||||
@ -1602,7 +1602,7 @@ void process_a_keystroke(void)
|
||||
if (input == KEY_MOUSE) {
|
||||
/* If the user clicked on a shortcut, read in the key code that it was
|
||||
* converted into. Else the click has been handled or was invalid. */
|
||||
if (do_mouse() == 1)
|
||||
if (process_click() == 1)
|
||||
input = get_kbinput(midwin, BLIND);
|
||||
else
|
||||
return;
|
||||
|
||||
15
src/prompt.c
15
src/prompt.c
@ -193,20 +193,19 @@ void paste_into_answer(void)
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_MOUSE
|
||||
/* Handle a mouse click on the status-bar prompt or the shortcut list. */
|
||||
int do_statusbar_mouse(void)
|
||||
/* Handle a mouse click in the prompt bar or the help lines. */
|
||||
int process_prompt_click(void)
|
||||
{
|
||||
int click_row, click_col;
|
||||
int retval = get_mouseinput(&click_row, &click_col);
|
||||
int retval = get_mouseinput(&click_row, &click_col); /* Handles shortcuts. */
|
||||
|
||||
/* We can click on the status-bar window text to move the cursor. */
|
||||
/* When the click is in the prompt bar, position the cursor. */
|
||||
if (retval == 0 && wmouse_trafo(footwin, &click_row, &click_col, FALSE)) {
|
||||
size_t start_col = breadth(prompt) + 2;
|
||||
|
||||
if (click_col >= start_col)
|
||||
typing_x = actual_x(answer,
|
||||
get_statusbar_page_start(start_col, start_col +
|
||||
wideness(answer, typing_x)) + click_col - start_col);
|
||||
typing_x = actual_x(answer, get_statusbar_page_start(start_col, start_col +
|
||||
wideness(answer, typing_x)) + click_col - start_col);
|
||||
else
|
||||
typing_x = 0;
|
||||
}
|
||||
@ -458,7 +457,7 @@ functionptrtype acquire_an_answer(int *actual, bool *listed,
|
||||
#endif
|
||||
#ifdef ENABLE_MOUSE
|
||||
/* For a click on a shortcut, read in the resulting keycode. */
|
||||
if (input == KEY_MOUSE && do_statusbar_mouse() == 1)
|
||||
if (input == KEY_MOUSE && process_prompt_click() == 1)
|
||||
input = get_kbinput(footwin, BLIND);
|
||||
if (input == KEY_MOUSE)
|
||||
continue;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user