commit a31896011a7165cc1ba109f8d9a8990bfa6fb50e
parent 769504c4952d1735af575159cbaf559b92ba7378
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Wed, 11 Jul 2018 11:11:30 +0200
tweaks: elide a one-line function -- no, a half-line function
Diffstat:
2 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/src/prompt.c b/src/prompt.c
@@ -43,7 +43,7 @@ int do_statusbar_mouse(void)
if (click_row == 0 && click_col >= start_col)
typing_x = actual_x(answer,
get_statusbar_page_start(start_col, start_col +
- statusbar_xplustabs()) + click_col - start_col);
+ strnlenpt(answer, typing_x)) + click_col - start_col);
}
return retval;
@@ -340,12 +340,6 @@ void do_statusbar_verbatim_input(void)
free(kbinput);
}
-/* Return the zero-based column position of the cursor in the answer. */
-size_t statusbar_xplustabs(void)
-{
- return strnlenpt(answer, typing_x);
-}
-
/* Paste the first line of the cutbuffer into the current answer. */
void do_statusbar_uncut_text(void)
{
@@ -413,8 +407,8 @@ void draw_the_promptbar(void)
wmove(bottomwin, 0, 0);
wrefresh(bottomwin);
- /* Place the cursor at typing_x in the answer. */
- column = base + statusbar_xplustabs();
+ /* Place the cursor at the right spot. */
+ column = base + strnlenpt(answer, typing_x);
wmove(bottomwin, 0, column - get_statusbar_page_start(base, column));
wnoutrefresh(bottomwin);
}
diff --git a/src/proto.h b/src/proto.h
@@ -460,7 +460,6 @@ void do_statusbar_prev_word(void);
void do_statusbar_next_word(void);
#endif
void do_statusbar_verbatim_input(void);
-size_t statusbar_xplustabs(void);
size_t get_statusbar_page_start(size_t start_col, size_t column);
void put_cursor_at_end_of_answer(void);
void add_or_remove_pipe_symbol_from_answer(void);