/* If we're using restricted mode, the filename
* isn't blank, and we're at the "Write File"
* prompt, disable Cut. */
- if (!ISSET(RESTRICTED) || openfile->filename[0] ==
- '\0' || currmenu != MWRITEFILE)
+ if (!ISSET(RESTRICTED) || openfile->filename[0] == '\0' ||
+ currmenu != MWRITEFILE)
do_statusbar_cut_text();
} else if (s->scfunc == do_left)
do_statusbar_left();
/* If we're using restricted mode, the filename
* isn't blank, and we're at the "Write File"
* prompt, disable Delete. */
- if (!ISSET(RESTRICTED) || openfile->filename[0] ==
- '\0' || currmenu != MWRITEFILE)
+ if (!ISSET(RESTRICTED) || openfile->filename[0] == '\0' ||
+ currmenu != MWRITEFILE)
do_statusbar_delete();
} else if (s->scfunc == do_backspace) {
/* If we're using restricted mode, the filename
* isn't blank, and we're at the "Write File"
* prompt, disable Backspace. */
- if (!ISSET(RESTRICTED) || openfile->filename[0] ==
- '\0' || currmenu != MWRITEFILE)
+ if (!ISSET(RESTRICTED) || openfile->filename[0] == '\0' ||
+ currmenu != MWRITEFILE)
do_statusbar_backspace();
} else {
/* Handle any other shortcut in the current menu, setting
update_statusbar_line(answer, statusbar_x);
}
-/* Get a string of input at the statusbar prompt. This should only be
- * called from do_prompt(). */
+/* Get a string of input at the statusbar prompt. */
functionptrtype get_prompt_string(int *actual, bool allow_tabs,
#ifndef DISABLE_TABCOMP
bool allow_files,
assert(statusbar_x <= strlen(answer));
#ifndef NANO_TINY
- if (kbinput == KEY_WINCH) {
- refresh_func();
- update_statusbar_line(answer, statusbar_x);
- continue;
- }
+ if (kbinput == KEY_WINCH) {
+ refresh_func();
+ update_statusbar_line(answer, statusbar_x);
+ continue;
+ }
#endif
-
func = func_from_key(&kbinput);
if (func == do_cancel || func == do_enter)
* history list, answer is blank, and magichistory is set,
* save magichistory in answer. */
if ((*history_list)->next == NULL &&
- *answer == '\0' && magichistory != NULL) {
- answer = mallocstrcpy(answer, magichistory);
- statusbar_x = strlen(answer);
- }
+ *answer == '\0' && magichistory != NULL) {
+ answer = mallocstrcpy(answer, magichistory);
+ statusbar_x = strlen(answer);
+ }
update_statusbar_line(answer, statusbar_x);
#if !defined(DISABLE_HISTORIES) && !defined(DISABLE_TABCOMP)
last_kbinput = kbinput;
#endif
-
reset_statusbar_cursor();
wnoutrefresh(bottomwin);
}
/* If we found something, and we're back at the exact same spot where
* we started searching, then this is the only occurrence. */
- if (fileptr == openfile->current && fileptr_x ==
- openfile->current_x && didfind) {
- statusbar(_("This is the only occurrence"));
- }
+ if (didfind && fileptr == openfile->current &&
+ fileptr_x == openfile->current_x)
+ statusbar(_("This is the only occurrence"));
openfile->placewewant = xplustabs();
edit_redraw(fileptr, pww_save);
last_search = mallocstrcpy(last_search, searchbot->prev->data);
#endif
- if (last_search[0] != '\0') {
+ if (last_search[0] == '\0')
+ statusbar(_("No current search pattern"));
+ else {
#ifdef HAVE_REGEX_H
/* Since answer is "", use last_search! */
if (ISSET(USE_REGEXP) && !regexp_init(last_search))
/* If we found something, and we're back at the exact same spot
* where we started searching, then this is the only occurrence. */
- if (fileptr == openfile->current && fileptr_x ==
- openfile->current_x && didfind) {
- statusbar(_("This is the only occurrence"));
- }
- } else
- statusbar(_("No current search pattern"));
+ if (didfind && fileptr == openfile->current &&
+ fileptr_x == openfile->current_x && didfind)
+ statusbar(_("This is the only occurrence"));
+ }
openfile->placewewant = xplustabs();
edit_redraw(fileptr, pww_save);
#ifndef DISABLE_COLOR
/* If color syntaxes are available and turned on, we
* need to call edit_refresh(). */
- if (openfile->colorstrings != NULL &&
- !ISSET(NO_COLOR_SYNTAX))
+ if (openfile->colorstrings != NULL && !ISSET(NO_COLOR_SYNTAX))
edit_refresh();
else
#endif