[help] add some more help text

pull/69/head
Timothy Stack 11 years ago
parent 945495b5d1
commit 9a6e1469ab

@ -67,11 +67,13 @@ indicates your current position in the file.
Above and below the main body are status lines that display:
* the current time;
* the number of errors/warnings above and below your current
position;
* the number of search hits, which updates as more are found;
* the line number for the top line in the display; and
* the name of the file the top line was pulled from.
* the name of the file the top line was pulled from;
* the log format for the top line;
* the current view;
* the line number for the top line in the display;
* the total number of warnings and errors;
* the number of search hits, which updates as more are found; and
* the number of lines not displayed because of filtering.
Finally, the last line on the display is where you can enter search
patterns and execute internal commands, such as converting a

@ -913,6 +913,7 @@ static void copy_to_xclip(void)
tc->get_bookmarks()[&textview_curses::BM_USER];
bookmark_vector<vis_line_t>::iterator iter;
FILE * pfile = NULL;
int line_count = 0;
string line;
/* XXX : Check if this is linux or MAC. Probably not the best solution but */
@ -932,10 +933,18 @@ static void copy_to_xclip(void)
for (iter = bv.begin(); iter != bv.end(); iter++) {
tc->grep_value_for_line(*iter, line);
fprintf(pfile, "%s\n", line.c_str());
line_count += 1;
}
pclose(pfile);
pfile = NULL;
char buffer[128];
snprintf(buffer, sizeof(buffer),
"Copied " ANSI_BOLD("%d") " lines to the clipboard",
line_count);
lnav_data.ld_rl_view->set_value(buffer);
}
static void handle_paging_key(int ch)
@ -994,6 +1003,8 @@ static void handle_paging_key(int ch)
if (lss) {
lss->get_user_bookmarks()[&textview_curses::BM_USER].clear();
tc->reload_data();
lnav_data.ld_rl_view->set_value("Cleared bookmarks");
}
break;
@ -1062,6 +1073,8 @@ static void handle_paging_key(int ch)
range);
if (range.second != INT_MAX) {
tc->set_left(range.second);
lnav_data.ld_rl_view->set_alt_value(
HELP_MSG_1(m, "to bookmark a line"));
}
else{
flash();
@ -1087,6 +1100,8 @@ static void handle_paging_key(int ch)
else{
tc->set_left(0);
}
lnav_data.ld_rl_view->set_alt_value(
HELP_MSG_1(m, "to bookmark a line"));
}
break;
@ -1365,6 +1380,8 @@ static void handle_paging_key(int ch)
--line;
}
tc->set_top(line);
lnav_data.ld_rl_view->set_alt_value(HELP_MSG_1(/, "to search"));
}
break;
@ -1376,6 +1393,8 @@ static void handle_paging_key(int ch)
lss->find_from_time(lnav_data.ld_top_time + step);
tc->set_top(line);
lnav_data.ld_rl_view->set_alt_value(HELP_MSG_1(/, "to search"));
}
break;
@ -1470,6 +1489,7 @@ static void handle_paging_key(int ch)
case 't':
if (lnav_data.ld_text_source.current_file() == NULL) {
flash();
lnav_data.ld_rl_view->set_value("No text files loaded");
}
else if (toggle_view(&lnav_data.ld_views[LNV_TEXT])) {
lnav_data.ld_rl_view->set_alt_value(HELP_MSG_2(
@ -1635,6 +1655,9 @@ static void handle_paging_key(int ch)
default:
fprintf(stderr, "unhandled %d\n", ch);
lnav_data.ld_rl_view->set_value("Unrecognized keystroke, press "
ANSI_BOLD("?")
" to view help");
flash();
break;
}
@ -1853,6 +1876,8 @@ static void rl_search(void *dummy, readline_curses *rc)
textview_curses::highlighter
hl(code, false, view_colors::VCR_SEARCH);
lnav_data.ld_bottom_source.set_prompt("");
textview_curses::highlight_map_t &hm = tc->get_highlights();
hm[name] = hl;
@ -1975,7 +2000,7 @@ static void rl_callback(void *dummy, readline_curses *rc)
ensure_view(&lnav_data.ld_views[LNV_DB]);
snprintf(row_count, sizeof(row_count),
"%'d row(s) matched",
ANSI_BOLD("%'d") " row(s) matched",
(int)dls.dls_rows.size());
rc->set_value(row_count);
rc->set_alt_value(HELP_MSG_2(

@ -638,6 +638,10 @@ void readline_curses::do_update(void)
wmove(this->vc_window, this->get_actual_y(), 0);
wclrtoeol(this->vc_window);
if (time(NULL) > this->rc_value_expiration) {
this->rc_value.clear();
}
al.get_string() = this->rc_value;
scrub_ansi_string(al.get_string(), al.get_attrs());

@ -187,6 +187,8 @@ public:
static const int KEY_TIMEOUT = 750 * 1000;
static const int VALUE_EXPIRATION = 20;
readline_curses();
virtual ~readline_curses();
@ -198,7 +200,10 @@ public:
void set_perform_action(action va) { this->rc_perform = va; };
void set_timeout_action(action va) { this->rc_timeout = va; };
void set_value(const std::string &value) { this->rc_value = value; };
void set_value(const std::string &value) {
this->rc_value = value;
this->rc_value_expiration = time(NULL) + VALUE_EXPIRATION;
};
std::string get_value() const { return this->rc_value; };
void set_alt_value(const std::string &value) { this->rc_alt_value = value; };
@ -268,6 +273,7 @@ private:
auto_fd rc_command_pipe[2];
std::map<int, readline_context *> rc_contexts;
std::string rc_value;
time_t rc_value_expiration;
std::string rc_alt_value;
action rc_perform;

Loading…
Cancel
Save