mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-26 06:39:43 +03:00
feedback: differentiate between remarks, mistakes, and information
Remarks are about unsurprising things but it's good to give feedback on them; "mistakes" are unexpected things, and get colored like an error; and information is something that the user requested and thus needs to stay on the status bar until the next keystroke.
This commit is contained in:
parent
54995defd2
commit
b86f7868d1
@ -712,7 +712,7 @@ void paste_text(void)
|
|||||||
/* The leftedge where we started the paste. */
|
/* The leftedge where we started the paste. */
|
||||||
|
|
||||||
if (cutbuffer == NULL) {
|
if (cutbuffer == NULL) {
|
||||||
statusbar(_("Cutbuffer is empty"));
|
statusline(AHEM, _("Cutbuffer is empty"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,7 +250,7 @@ typedef enum {
|
|||||||
} format_type;
|
} format_type;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
VACUUM, HUSH, NOTICE, MILD, ALERT
|
VACUUM, HUSH, REMARK, INFO, NOTICE, AHEM, MILD, ALERT
|
||||||
} message_type;
|
} message_type;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
@ -520,7 +520,7 @@ void redecorate_after_switch(void)
|
|||||||
{
|
{
|
||||||
/* If only one file buffer is open, there is nothing to update. */
|
/* If only one file buffer is open, there is nothing to update. */
|
||||||
if (openfile == openfile->next) {
|
if (openfile == openfile->next) {
|
||||||
statusbar(_("No more open file buffers"));
|
statusline(AHEM, _("No more open file buffers"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -832,7 +832,7 @@ int open_file(const char *filename, bool new_one, FILE **f)
|
|||||||
free(full_filename);
|
free(full_filename);
|
||||||
|
|
||||||
if (new_one) {
|
if (new_one) {
|
||||||
statusbar(_("New File"));
|
statusline(REMARK, _("New File"));
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
statusline(ALERT, _("File \"%s\" not found"), filename);
|
statusline(ALERT, _("File \"%s\" not found"), filename);
|
||||||
@ -2165,7 +2165,7 @@ int do_writeout(bool exiting, bool withprompt)
|
|||||||
did_credits = TRUE;
|
did_credits = TRUE;
|
||||||
} else
|
} else
|
||||||
/* TRANSLATORS: Concisely say the screen is too small. */
|
/* TRANSLATORS: Concisely say the screen is too small. */
|
||||||
statusbar(_("Too tiny"));
|
statusline(AHEM, _("Too tiny"));
|
||||||
|
|
||||||
free(given);
|
free(given);
|
||||||
return 0;
|
return 0;
|
||||||
|
30
src/nano.c
30
src/nano.c
@ -197,14 +197,14 @@ void renumber_from(linestruct *line)
|
|||||||
/* Display a warning about a key disabled in view mode. */
|
/* Display a warning about a key disabled in view mode. */
|
||||||
void print_view_warning(void)
|
void print_view_warning(void)
|
||||||
{
|
{
|
||||||
statusbar(_("Key is invalid in view mode"));
|
statusline(AHEM, _("Key is invalid in view mode"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* When in restricted mode, show a warning and return TRUE. */
|
/* When in restricted mode, show a warning and return TRUE. */
|
||||||
bool in_restricted_mode(void)
|
bool in_restricted_mode(void)
|
||||||
{
|
{
|
||||||
if (ISSET(RESTRICTED)) {
|
if (ISSET(RESTRICTED)) {
|
||||||
statusbar(_("This function is disabled in restricted mode"));
|
statusline(AHEM, _("This function is disabled in restricted mode"));
|
||||||
beep();
|
beep();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} else
|
} else
|
||||||
@ -953,7 +953,7 @@ void do_suspend(int signal)
|
|||||||
void do_suspend_void(void)
|
void do_suspend_void(void)
|
||||||
{
|
{
|
||||||
if (!ISSET(SUSPENDABLE)) {
|
if (!ISSET(SUSPENDABLE)) {
|
||||||
statusbar(_("Suspension is not enabled"));
|
statusline(AHEM, _("Suspension is not enabled"));
|
||||||
beep();
|
beep();
|
||||||
} else
|
} else
|
||||||
do_suspend(0);
|
do_suspend(0);
|
||||||
@ -1113,7 +1113,7 @@ void do_toggle(int flag)
|
|||||||
|
|
||||||
if (!ISSET(MINIBAR) || flag == SMART_HOME || flag == CUT_FROM_CURSOR ||
|
if (!ISSET(MINIBAR) || flag == SMART_HOME || flag == CUT_FROM_CURSOR ||
|
||||||
flag == TABS_TO_SPACES || flag == USE_MOUSE || flag == SUSPENDABLE)
|
flag == TABS_TO_SPACES || flag == USE_MOUSE || flag == SUSPENDABLE)
|
||||||
statusline(HUSH, "%s %s", _(flagtostr(flag)),
|
statusline(REMARK, "%s %s", _(flagtostr(flag)),
|
||||||
enabled ? _("enabled") : _("disabled"));
|
enabled ? _("enabled") : _("disabled"));
|
||||||
}
|
}
|
||||||
#endif /* !NANO_TINY */
|
#endif /* !NANO_TINY */
|
||||||
@ -1255,28 +1255,28 @@ void unbound_key(int code)
|
|||||||
if (code == FOREIGN_SEQUENCE)
|
if (code == FOREIGN_SEQUENCE)
|
||||||
/* TRANSLATORS: This refers to a sequence of escape codes
|
/* TRANSLATORS: This refers to a sequence of escape codes
|
||||||
* (from the keyboard) that nano does not recognize. */
|
* (from the keyboard) that nano does not recognize. */
|
||||||
statusline(ALERT, _("Unknown sequence"));
|
statusline(AHEM, _("Unknown sequence"));
|
||||||
else if (code > 0x7F)
|
else if (code > 0x7F)
|
||||||
statusline(ALERT, _("Unbound key"));
|
statusline(AHEM, _("Unbound key"));
|
||||||
else if (meta_key) {
|
else if (meta_key) {
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
if (code < 0x20)
|
if (code < 0x20)
|
||||||
statusline(ALERT, _("Unbindable key: M-^%c"), code + 0x40);
|
statusline(AHEM, _("Unbindable key: M-^%c"), code + 0x40);
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_NANORC
|
#ifdef ENABLE_NANORC
|
||||||
if (shifted_metas && 'A' <= code && code <= 'Z')
|
if (shifted_metas && 'A' <= code && code <= 'Z')
|
||||||
statusline(ALERT, _("Unbound key: Sh-M-%c"), code);
|
statusline(AHEM, _("Unbound key: Sh-M-%c"), code);
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
statusline(ALERT, _("Unbound key: M-%c"), toupper(code));
|
statusline(AHEM, _("Unbound key: M-%c"), toupper(code));
|
||||||
} else if (code == ESC_CODE)
|
} else if (code == ESC_CODE)
|
||||||
statusline(ALERT, _("Unbindable key: ^["));
|
statusline(AHEM, _("Unbindable key: ^["));
|
||||||
else if (code < 0x20)
|
else if (code < 0x20)
|
||||||
statusline(ALERT, _("Unbound key: ^%c"), code + 0x40);
|
statusline(AHEM, _("Unbound key: ^%c"), code + 0x40);
|
||||||
#if defined(ENABLE_BROWSER) || defined (ENABLE_HELP)
|
#if defined(ENABLE_BROWSER) || defined (ENABLE_HELP)
|
||||||
else
|
else
|
||||||
statusline(ALERT, _("Unbound key: %c"), code);
|
statusline(AHEM, _("Unbound key: %c"), code);
|
||||||
#endif
|
#endif
|
||||||
set_blankdelay_to_one();
|
set_blankdelay_to_one();
|
||||||
}
|
}
|
||||||
@ -2495,10 +2495,6 @@ int main(int argc, char **argv)
|
|||||||
openfile->next == openfile && !ISSET(NO_HELP))
|
openfile->next == openfile && !ISSET(NO_HELP))
|
||||||
statusbar(_("Welcome to nano. For basic help, type Ctrl+G."));
|
statusbar(_("Welcome to nano. For basic help, type Ctrl+G."));
|
||||||
#endif
|
#endif
|
||||||
#ifndef NANO_TINY
|
|
||||||
if (ISSET(MINIBAR) && lastmessage < ALERT)
|
|
||||||
lastmessage = VACUUM;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
we_are_running = TRUE;
|
we_are_running = TRUE;
|
||||||
|
|
||||||
@ -2514,7 +2510,7 @@ int main(int argc, char **argv)
|
|||||||
bottombars(MMAIN);
|
bottombars(MMAIN);
|
||||||
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
if (ISSET(MINIBAR) && COLS > 48 && lastmessage == VACUUM)
|
if (ISSET(MINIBAR) && COLS > 48 && lastmessage < REMARK)
|
||||||
minibar();
|
minibar();
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
28
src/search.c
28
src/search.c
@ -42,7 +42,7 @@ bool regexp_init(const char *regexp)
|
|||||||
char *str = nmalloc(len);
|
char *str = nmalloc(len);
|
||||||
|
|
||||||
regerror(value, &search_regexp, str, len);
|
regerror(value, &search_regexp, str, len);
|
||||||
statusline(ALERT, _("Bad regex \"%s\": %s"), regexp, str);
|
statusline(AHEM, _("Bad regex \"%s\": %s"), regexp, str);
|
||||||
free(str);
|
free(str);
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -251,7 +251,7 @@ int findnextstr(const char *needle, bool whole_word_only, int modus,
|
|||||||
line = (ISSET(BACKWARDS_SEARCH)) ? openfile->filebot : openfile->filetop;
|
line = (ISSET(BACKWARDS_SEARCH)) ? openfile->filebot : openfile->filetop;
|
||||||
|
|
||||||
if (modus == JUSTFIND) {
|
if (modus == JUSTFIND) {
|
||||||
statusbar(_("Search Wrapped"));
|
statusline(REMARK, _("Search Wrapped"));
|
||||||
/* Delay the "Searching..." message for at least two seconds. */
|
/* Delay the "Searching..." message for at least two seconds. */
|
||||||
feedback = -2;
|
feedback = -2;
|
||||||
}
|
}
|
||||||
@ -356,7 +356,7 @@ void do_research(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (*last_search == '\0') {
|
if (*last_search == '\0') {
|
||||||
statusbar(_("No current search pattern"));
|
statusline(AHEM, _("No current search pattern"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -394,7 +394,7 @@ void not_found_msg(const char *str)
|
|||||||
char *disp = display_string(str, 0, (COLS / 2) + 1, FALSE, FALSE);
|
char *disp = display_string(str, 0, (COLS / 2) + 1, FALSE, FALSE);
|
||||||
size_t numchars = actual_x(disp, wideness(disp, COLS / 2));
|
size_t numchars = actual_x(disp, wideness(disp, COLS / 2));
|
||||||
|
|
||||||
statusline(HUSH, _("\"%.*s%s\" not found"), numchars, disp,
|
statusline(AHEM, _("\"%.*s%s\" not found"), numchars, disp,
|
||||||
(disp[numchars] == '\0') ? "" : "...");
|
(disp[numchars] == '\0') ? "" : "...");
|
||||||
free(disp);
|
free(disp);
|
||||||
}
|
}
|
||||||
@ -421,14 +421,14 @@ void go_looking(void)
|
|||||||
* where we started searching, then this is the only occurrence. */
|
* where we started searching, then this is the only occurrence. */
|
||||||
if (didfind == 1 && openfile->current == was_current &&
|
if (didfind == 1 && openfile->current == was_current &&
|
||||||
openfile->current_x == was_current_x)
|
openfile->current_x == was_current_x)
|
||||||
statusbar(_("This is the only occurrence"));
|
statusline(REMARK, _("This is the only occurrence"));
|
||||||
else if (didfind == 1 && LINES == 1)
|
else if (didfind == 1 && LINES == 1)
|
||||||
refresh_needed = TRUE;
|
refresh_needed = TRUE;
|
||||||
else if (didfind == 0)
|
else if (didfind == 0)
|
||||||
not_found_msg(last_search);
|
not_found_msg(last_search);
|
||||||
|
|
||||||
#ifdef TIMEIT
|
#ifdef TIMEIT
|
||||||
statusline(HUSH, "Took: %.2f", (double)(clock() - start) / CLOCKS_PER_SEC);
|
statusline(INFO, "Took: %.2f", (double)(clock() - start) / CLOCKS_PER_SEC);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
edit_redraw(was_current, CENTERING);
|
edit_redraw(was_current, CENTERING);
|
||||||
@ -750,7 +750,7 @@ void ask_for_and_do_replacements(void)
|
|||||||
refresh_needed = TRUE;
|
refresh_needed = TRUE;
|
||||||
|
|
||||||
if (numreplaced >= 0)
|
if (numreplaced >= 0)
|
||||||
statusline(HUSH, P_("Replaced %zd occurrence",
|
statusline(REMARK, P_("Replaced %zd occurrence",
|
||||||
"Replaced %zd occurrences", numreplaced), numreplaced);
|
"Replaced %zd occurrences", numreplaced), numreplaced);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -798,7 +798,7 @@ void do_gotolinecolumn(ssize_t line, ssize_t column, bool retain_answer,
|
|||||||
|
|
||||||
/* Try to extract one or two numbers from the user's response. */
|
/* Try to extract one or two numbers from the user's response. */
|
||||||
if (!parse_line_column(answer, &line, &column)) {
|
if (!parse_line_column(answer, &line, &column)) {
|
||||||
statusline(ALERT, _("Invalid line or column number"));
|
statusline(AHEM, _("Invalid line or column number"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -946,7 +946,7 @@ void do_find_bracket(void)
|
|||||||
ch = mbstrchr(matchbrackets, openfile->current->data + openfile->current_x);
|
ch = mbstrchr(matchbrackets, openfile->current->data + openfile->current_x);
|
||||||
|
|
||||||
if (ch == NULL) {
|
if (ch == NULL) {
|
||||||
statusbar(_("Not a bracket"));
|
statusline(AHEM, _("Not a bracket"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -989,7 +989,7 @@ void do_find_bracket(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
statusbar(_("No matching bracket"));
|
statusline(AHEM, _("No matching bracket"));
|
||||||
|
|
||||||
/* Restore the cursor position. */
|
/* Restore the cursor position. */
|
||||||
openfile->current = was_current;
|
openfile->current = was_current;
|
||||||
@ -1004,9 +1004,9 @@ void put_or_lift_anchor(void)
|
|||||||
update_line(openfile->current, openfile->current_x);
|
update_line(openfile->current, openfile->current_x);
|
||||||
|
|
||||||
if (openfile->current->has_anchor)
|
if (openfile->current->has_anchor)
|
||||||
statusbar(_("Placed anchor"));
|
statusline(REMARK, _("Placed anchor"));
|
||||||
else
|
else
|
||||||
statusbar(_("Removed anchor"));
|
statusline(REMARK, _("Removed anchor"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make the given line the current line, or report the anchoredness. */
|
/* Make the given line the current line, or report the anchoredness. */
|
||||||
@ -1020,9 +1020,9 @@ void go_to_and_confirm(linestruct *line)
|
|||||||
edit_redraw(was_current, CENTERING);
|
edit_redraw(was_current, CENTERING);
|
||||||
statusbar(_("Jumped to anchor"));
|
statusbar(_("Jumped to anchor"));
|
||||||
} else if (openfile->current->has_anchor)
|
} else if (openfile->current->has_anchor)
|
||||||
statusbar(_("This is the only anchor"));
|
statusline(REMARK, _("This is the only anchor"));
|
||||||
else
|
else
|
||||||
statusbar(_("There are no anchors"));
|
statusline(AHEM, _("There are no anchors"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Jump to the first anchor before the current line; wrap around at the top. */
|
/* Jump to the first anchor before the current line; wrap around at the top. */
|
||||||
|
44
src/text.c
44
src/text.c
@ -387,7 +387,7 @@ void do_comment(void)
|
|||||||
comment_seq = openfile->syntax->comment;
|
comment_seq = openfile->syntax->comment;
|
||||||
|
|
||||||
if (*comment_seq == '\0') {
|
if (*comment_seq == '\0') {
|
||||||
statusbar(_("Commenting is not supported for this file type"));
|
statusline(AHEM, _("Commenting is not supported for this file type"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -397,7 +397,7 @@ void do_comment(void)
|
|||||||
|
|
||||||
/* If only the magic line is selected, don't do anything. */
|
/* If only the magic line is selected, don't do anything. */
|
||||||
if (top == bot && bot == openfile->filebot && !ISSET(NO_NEWLINES)) {
|
if (top == bot && bot == openfile->filebot && !ISSET(NO_NEWLINES)) {
|
||||||
statusbar(_("Cannot comment past end of file"));
|
statusline(AHEM, _("Cannot comment past end of file"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -519,7 +519,7 @@ void do_undo(void)
|
|||||||
size_t original_x, regain_from_x;
|
size_t original_x, regain_from_x;
|
||||||
|
|
||||||
if (u == NULL) {
|
if (u == NULL) {
|
||||||
statusbar(_("Nothing to undo"));
|
statusline(AHEM, _("Nothing to undo"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -696,7 +696,7 @@ void do_redo(void)
|
|||||||
undostruct *u = openfile->undotop;
|
undostruct *u = openfile->undotop;
|
||||||
|
|
||||||
if (u == NULL || u == openfile->current_undo) {
|
if (u == NULL || u == openfile->current_undo) {
|
||||||
statusbar(_("Nothing to redo"));
|
statusline(AHEM, _("Nothing to redo"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1786,7 +1786,7 @@ void do_justify(bool full_justify)
|
|||||||
|
|
||||||
/* When the marked region is empty, do nothing. */
|
/* When the marked region is empty, do nothing. */
|
||||||
if (startline == endline && start_x == end_x) {
|
if (startline == endline && start_x == end_x) {
|
||||||
statusline(ALERT, _("Selection is empty"));
|
statusline(AHEM, _("Selection is empty"));
|
||||||
discard_until(openfile->undotop->next);
|
discard_until(openfile->undotop->next);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1998,7 +1998,7 @@ void do_justify(bool full_justify)
|
|||||||
/* Show what we justified on the status bar. */
|
/* Show what we justified on the status bar. */
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
if (openfile->mark)
|
if (openfile->mark)
|
||||||
statusbar(_("Justified selection"));
|
statusline(REMARK, _("Justified selection"));
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
if (full_justify)
|
if (full_justify)
|
||||||
@ -2106,10 +2106,10 @@ void treat(char *tempfile_name, char *theprogram, bool spelling)
|
|||||||
if (fileinfo.st_size == 0) {
|
if (fileinfo.st_size == 0) {
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
if (spelling && openfile->mark)
|
if (spelling && openfile->mark)
|
||||||
statusline(ALERT, _("Selection is empty"));
|
statusline(AHEM, _("Selection is empty"));
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
statusbar(_("Buffer is empty"));
|
statusline(AHEM, _("Buffer is empty"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2155,7 +2155,7 @@ void treat(char *tempfile_name, char *theprogram, bool spelling)
|
|||||||
if (timestamp_sec > 0 && stat(tempfile_name, &fileinfo) == 0 &&
|
if (timestamp_sec > 0 && stat(tempfile_name, &fileinfo) == 0 &&
|
||||||
(long)fileinfo.st_mtim.tv_sec == timestamp_sec &&
|
(long)fileinfo.st_mtim.tv_sec == timestamp_sec &&
|
||||||
(long)fileinfo.st_mtim.tv_nsec == timestamp_nsec) {
|
(long)fileinfo.st_mtim.tv_nsec == timestamp_nsec) {
|
||||||
statusbar(_("Nothing changed"));
|
statusline(REMARK, _("Nothing changed"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2203,9 +2203,9 @@ void treat(char *tempfile_name, char *theprogram, bool spelling)
|
|||||||
adjust_viewport(STATIONARY);
|
adjust_viewport(STATIONARY);
|
||||||
|
|
||||||
if (spelling)
|
if (spelling)
|
||||||
statusbar(_("Finished checking spelling"));
|
statusline(REMARK, _("Finished checking spelling"));
|
||||||
else
|
else
|
||||||
statusbar(_("Buffer has been processed"));
|
statusline(REMARK, _("Buffer has been processed"));
|
||||||
}
|
}
|
||||||
#endif /* ENABLE_SPELLER || ENABLE_COLOR */
|
#endif /* ENABLE_SPELLER || ENABLE_COLOR */
|
||||||
|
|
||||||
@ -2490,7 +2490,7 @@ void do_int_speller(const char *tempfile_name)
|
|||||||
else if (WIFEXITED(spell_status) == 0 || WEXITSTATUS(spell_status))
|
else if (WIFEXITED(spell_status) == 0 || WEXITSTATUS(spell_status))
|
||||||
statusline(ALERT, _("Error invoking \"spell\""));
|
statusline(ALERT, _("Error invoking \"spell\""));
|
||||||
else
|
else
|
||||||
statusbar(_("Finished checking spelling"));
|
statusline(REMARK, _("Finished checking spelling"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Spell check the current file. If an alternate spell checker is
|
/* Spell check the current file. If an alternate spell checker is
|
||||||
@ -2573,7 +2573,7 @@ void do_linter(void)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (!openfile->syntax || !openfile->syntax->linter) {
|
if (!openfile->syntax || !openfile->syntax->linter) {
|
||||||
statusbar(_("No linter is defined for this type of file"));
|
statusline(AHEM, _("No linter is defined for this type of file"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2733,7 +2733,7 @@ void do_linter(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!parsesuccess) {
|
if (!parsesuccess) {
|
||||||
statusline(HUSH, _("Got 0 parsable lines from command: %s"),
|
statusline(REMARK, _("Got 0 parsable lines from command: %s"),
|
||||||
openfile->syntax->linter);
|
openfile->syntax->linter);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2810,7 +2810,7 @@ void do_linter(void)
|
|||||||
free(dontwantfile);
|
free(dontwantfile);
|
||||||
|
|
||||||
if (restlint == NULL) {
|
if (restlint == NULL) {
|
||||||
statusbar(_("No messages for this file"));
|
statusline(REMARK, _("No messages for this file"));
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
curlint = restlint;
|
curlint = restlint;
|
||||||
@ -2912,7 +2912,7 @@ void do_formatter(void)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (!openfile->syntax || !openfile->syntax->formatter) {
|
if (!openfile->syntax || !openfile->syntax->formatter) {
|
||||||
statusbar(_("No formatter is defined for this type of file"));
|
statusline(AHEM, _("No formatter is defined for this type of file"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2989,7 +2989,7 @@ void do_wordlinechar_count(void)
|
|||||||
openfile->current_x = was_x;
|
openfile->current_x = was_x;
|
||||||
|
|
||||||
/* Report on the status bar the number of lines, words, and characters. */
|
/* Report on the status bar the number of lines, words, and characters. */
|
||||||
statusline(HUSH, _("%s%zd %s, %zu %s, %zu %s"),
|
statusline(INFO, _("%s%zd %s, %zu %s, %zu %s"),
|
||||||
openfile->mark ? _("In Selection: ") : "",
|
openfile->mark ? _("In Selection: ") : "",
|
||||||
lines, P_("line", "lines", lines),
|
lines, P_("line", "lines", lines),
|
||||||
words, P_("word", "words", words),
|
words, P_("word", "words", words),
|
||||||
@ -3004,7 +3004,7 @@ void do_verbatim_input(void)
|
|||||||
char *bytes;
|
char *bytes;
|
||||||
|
|
||||||
/* TRANSLATORS: Shown when the next keystroke will be inserted verbatim. */
|
/* TRANSLATORS: Shown when the next keystroke will be inserted verbatim. */
|
||||||
statusbar(_("Verbatim Input"));
|
statusline(INFO, _("Verbatim Input"));
|
||||||
place_the_cursor();
|
place_the_cursor();
|
||||||
|
|
||||||
/* Read in the first one or two bytes of the next keystroke. */
|
/* Read in the first one or two bytes of the next keystroke. */
|
||||||
@ -3022,7 +3022,7 @@ void do_verbatim_input(void)
|
|||||||
wipe_statusbar();
|
wipe_statusbar();
|
||||||
} else
|
} else
|
||||||
/* TRANSLATORS: An invalid verbatim Unicode code was typed. */
|
/* TRANSLATORS: An invalid verbatim Unicode code was typed. */
|
||||||
statusline(ALERT, _("Invalid code"));
|
statusline(AHEM, _("Invalid code"));
|
||||||
|
|
||||||
free(bytes);
|
free(bytes);
|
||||||
}
|
}
|
||||||
@ -3098,7 +3098,7 @@ void complete_a_word(void)
|
|||||||
/* If there is no word fragment before the cursor, do nothing. */
|
/* If there is no word fragment before the cursor, do nothing. */
|
||||||
if (start_of_shard == openfile->current_x) {
|
if (start_of_shard == openfile->current_x) {
|
||||||
/* TRANSLATORS: Shown when no text is directly left of the cursor. */
|
/* TRANSLATORS: Shown when no text is directly left of the cursor. */
|
||||||
statusbar(_("No word fragment"));
|
statusline(AHEM, _("No word fragment"));
|
||||||
pletion_line = NULL;
|
pletion_line = NULL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -3190,11 +3190,11 @@ void complete_a_word(void)
|
|||||||
|
|
||||||
/* The search has reached the end of the file. */
|
/* The search has reached the end of the file. */
|
||||||
if (list_of_completions != NULL) {
|
if (list_of_completions != NULL) {
|
||||||
statusline(ALERT, _("No further matches"));
|
statusline(AHEM, _("No further matches"));
|
||||||
refresh_needed = TRUE;
|
refresh_needed = TRUE;
|
||||||
} else
|
} else
|
||||||
/* TRANSLATORS: Shown when there are zero possible completions. */
|
/* TRANSLATORS: Shown when there are zero possible completions. */
|
||||||
statusline(ALERT, _("No matches"));
|
statusline(AHEM, _("No matches"));
|
||||||
|
|
||||||
free(shard);
|
free(shard);
|
||||||
}
|
}
|
||||||
|
25
src/winio.c
25
src/winio.c
@ -91,10 +91,10 @@ void record_macro(void)
|
|||||||
|
|
||||||
if (recording) {
|
if (recording) {
|
||||||
macro_length = 0;
|
macro_length = 0;
|
||||||
statusbar(_("Recording a macro..."));
|
statusline(REMARK, _("Recording a macro..."));
|
||||||
} else {
|
} else {
|
||||||
snip_last_keystroke();
|
snip_last_keystroke();
|
||||||
statusbar(_("Stopped recording"));
|
statusline(REMARK, _("Stopped recording"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ISSET(STATEFLAGS))
|
if (ISSET(STATEFLAGS))
|
||||||
@ -106,13 +106,13 @@ void record_macro(void)
|
|||||||
void run_macro(void)
|
void run_macro(void)
|
||||||
{
|
{
|
||||||
if (recording) {
|
if (recording) {
|
||||||
statusbar(_("Cannot run macro while recording"));
|
statusline(AHEM, _("Cannot run macro while recording"));
|
||||||
snip_last_keystroke();
|
snip_last_keystroke();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (macro_length == 0) {
|
if (macro_length == 0) {
|
||||||
statusbar(_("Macro is empty"));
|
statusline(REMARK, _("Macro is empty"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,8 +185,8 @@ void read_keys_from(WINDOW *win)
|
|||||||
curs_set(1);
|
curs_set(1);
|
||||||
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
if (currmenu == MMAIN && ISSET(MINIBAR) &&
|
if (currmenu == MMAIN && ISSET(MINIBAR) && lastmessage > HUSH &&
|
||||||
lastmessage > VACUUM && lastmessage < ALERT) {
|
lastmessage != INFO && lastmessage < ALERT) {
|
||||||
timed = TRUE;
|
timed = TRUE;
|
||||||
halfdelay(8);
|
halfdelay(8);
|
||||||
disable_kb_interrupt();
|
disable_kb_interrupt();
|
||||||
@ -209,6 +209,7 @@ void read_keys_from(WINDOW *win)
|
|||||||
|
|
||||||
if (input == ERR) {
|
if (input == ERR) {
|
||||||
minibar();
|
minibar();
|
||||||
|
as_an_at = TRUE;
|
||||||
place_the_cursor();
|
place_the_cursor();
|
||||||
doupdate();
|
doupdate();
|
||||||
continue;
|
continue;
|
||||||
@ -1336,7 +1337,7 @@ long assemble_unicode(int symbol)
|
|||||||
|
|
||||||
/* TRANSLATORS: This is shown while a six-digit hexadecimal
|
/* TRANSLATORS: This is shown while a six-digit hexadecimal
|
||||||
* Unicode character code (%s) is being typed in. */
|
* Unicode character code (%s) is being typed in. */
|
||||||
statusline(HUSH, _("Unicode Input: %s"), partial);
|
statusline(INFO, _("Unicode Input: %s"), partial);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we have an end result, reset the Unicode digit counter. */
|
/* If we have an end result, reset the Unicode digit counter. */
|
||||||
@ -2135,8 +2136,7 @@ void statusline(message_type importance, const char *msg, ...)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Ignore a message with an importance that is lower than the last one. */
|
/* Ignore a message with an importance that is lower than the last one. */
|
||||||
if ((lastmessage == ALERT && importance != ALERT) ||
|
if (importance < lastmessage && lastmessage > NOTICE)
|
||||||
(lastmessage == MILD && importance == HUSH))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* If there are multiple alert messages, add trailing dots to the first. */
|
/* If there are multiple alert messages, add trailing dots to the first. */
|
||||||
@ -2154,8 +2154,9 @@ void statusline(message_type importance, const char *msg, ...)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (importance == ALERT) {
|
if (importance > NOTICE) {
|
||||||
beep();
|
if (importance == ALERT)
|
||||||
|
beep();
|
||||||
colorpair = interface_color_pair[ERROR_MESSAGE];
|
colorpair = interface_color_pair[ERROR_MESSAGE];
|
||||||
} else if (importance == NOTICE)
|
} else if (importance == NOTICE)
|
||||||
colorpair = interface_color_pair[SELECTED_TEXT];
|
colorpair = interface_color_pair[SELECTED_TEXT];
|
||||||
@ -3376,7 +3377,7 @@ void report_cursor_position(void)
|
|||||||
colpct = 100 * column / fullwidth;
|
colpct = 100 * column / fullwidth;
|
||||||
charpct = (openfile->totsize == 0) ? 0 : 100 * sum / openfile->totsize;
|
charpct = (openfile->totsize == 0) ? 0 : 100 * sum / openfile->totsize;
|
||||||
|
|
||||||
statusline(HUSH,
|
statusline(INFO,
|
||||||
_("line %zd/%zd (%d%%), col %zu/%zu (%d%%), char %zu/%zu (%d%%)"),
|
_("line %zd/%zd (%d%%), col %zu/%zu (%d%%), char %zu/%zu (%d%%)"),
|
||||||
openfile->current->lineno, openfile->filebot->lineno, linepct,
|
openfile->current->lineno, openfile->filebot->lineno, linepct,
|
||||||
column, fullwidth, colpct, sum, openfile->totsize, charpct);
|
column, fullwidth, colpct, sum, openfile->totsize, charpct);
|
||||||
|
Loading…
Reference in New Issue
Block a user