[mouse] update the status line when the mouse is enabled/disabled

This commit is contained in:
Timothy Stack 2016-05-03 20:47:41 -07:00
parent 1850c4f678
commit deccd51bdf
4 changed files with 9 additions and 4 deletions

View File

@ -794,7 +794,8 @@ private:
blank.e_token = DT_QUOTED_STRING;
blank.e_capture.c_begin = blank.e_capture.c_end = pair_subs.front().e_capture.c_end;
if (blank.e_capture.c_begin < pi.pi_length) {
if ((blank.e_capture.c_begin >= 0) &&
((size_t) blank.e_capture.c_begin < pi.pi_length)) {
switch (str[blank.e_capture.c_begin]) {
case '=':
case ':':
@ -922,7 +923,7 @@ private:
*(this->dp_msg_format) += this->get_string_up_to_value(*fiter);
this->dp_msg_format->append("#");
}
if (this->dp_msg_format_begin < pi.pi_length) {
if ((size_t) this->dp_msg_format_begin < pi.pi_length) {
const char *str = pi.get_string();
pcre_context::capture_t last(this->dp_msg_format_begin,
pi.pi_length);

View File

@ -262,6 +262,10 @@ void handle_paging_key(int ch)
case KEY_F(2):
if (xterm_mouse::is_available()) {
lnav_data.ld_mouse.set_enabled(!lnav_data.ld_mouse.is_enabled());
lnav_data.ld_rl_view->set_value(
string("info: mouse mode -- ") +
(lnav_data.ld_mouse.is_enabled() ?
ANSI_BOLD("enabled") : ANSI_BOLD("disabled")));
}
else {
lnav_data.ld_rl_view->set_value(

View File

@ -1671,7 +1671,7 @@ static void looper(void)
readline_context sql_context("sql", NULL, false);
readline_context exec_context("exec");
readline_curses rlc;
sig_atomic_t overlay_counter;
sig_atomic_t overlay_counter = 0;
int lpc;
command_context.set_highlighter(readline_command_highlighter);

View File

@ -336,7 +336,7 @@ struct date_time_scanner {
bool convert_local = true);
bool convert_to_timeval(const char *time_src,
size_t time_len,
ssize_t time_len,
struct timeval &tv_out) {
struct exttm tm;