edit_update(), rename open_the_file() to open_file() since the
latter has been removed, and rename load_a_file() to
load_buffer().
- - Add alternative shortcuts to the main list for moving to the
- beginning and end of a paragraph and justifying the entire
- file: Meta-( (Meta-9), Meta-) (Meta-0), and Meta-J,
- respectively. Do this because Pico's practice of putting these
- shortcuts in the search menu is rather odd. (DLR)
+ - Add alternative shortcuts to the main and search shortcut
+ lists for moving to the beginning and end of a paragraph and
+ justifying the entire file: Meta-( (Meta-9), Meta-) (Meta-0),
+ and Meta-J, respectively. Do this because Pico's practice of
+ putting these shortcuts only in the search shortcut list is
+ rather odd. (DLR)
- Turn off extended input processing (the IEXTEN termios flag)
as nano 1.2.x does. New function disable_extended_input();
changes to terminal_init(). (DLR)
- Add a multibuffer mode toggle to the "Execute Command" prompt,
for consistency with the "Read File" prompt. Changes to
do_insertfile() and shortcut_init(). (DLR)
+ - Add an ^X toggle to the "Execute Command" prompt to go back to
+ the "Insert File" prompt, and add a ^T toggle to the "Go To
+ Line" prompt to go back to the "Where Is" prompt. Changes to
+ do_insertfile(), shortcut_init(), do_gotoline(), etc.
+ - Make sure a few uninitialized static variables are initialized
+ to sane values. (DLR)
- files.c:
do_insertfile()
- Readd the NANO_SMALL #ifdef around the start_again: label to
avoid a warning. (DLR)
- - Simplify by reusing variables where possible. (DLR)
+ - Simplify by reusing variables whereever possible. (DLR)
- global.c:
shortcut_init()
- Remove redundant NANO_SMALL #ifdef. (DLR)
- If there are more than MAIN_VISIBLE shortcuts available, only
register clicks on the first MAIN_VISIBLE shortcuts, since
bottombars() only shows that many shortcuts. (DLR)
+ check_statblank()
+ - Rename to check_statusblank(), and rename its associated
+ global int statusblank too. (DLR)
nanogetstr()
- Refresh the screen when Ctrl-L is pressed at the statusbar
prompt, as Pico does. (DLR)
+ - Always return the key pressed by the user. (DLR)
+ statusq()
+ - Rework slightly to reset the cursor position when the user
+ hits Enter as well as Cancel. This means that resetstatuspos
+ no longer needs to be global. (DLR)
reset_cursor()
- If this is called before any files have been opened, as it can
be by statusbar(), put the cursor at the top left corner of
- Keystroke to implement "Add next sequence as raw" like vi's ^V.
[DONE for edit window, needs to be done for statusbar prompt]
- Spell check selected text only. [DONE]
-- Make "To line" (^W^T) and "Read from Command" (^R^X) re-enter their
+- Make "To Line" (^W^T) and "Read from Command" (^R^X) reenter their
parent menu when their keystroke is entered a second time (^W^T^T and
- (^R^X^X)(requires figuring out when to keep cursor pos and when not
- to).
-- Fix resetstatuspos global which we shouldn't have.
+ (^R^X^X) (requires figuring out when to keep cursor position and when
+ not to). [DONE]
+- Fix resetstatuspos global which we shouldn't have. [DONE]
- Rewrite the nano FAQ in SGML.
Old requests:
/* Is the cutbuffer from a mark? 0 means whole-line cut, 1
* means mark, and 2 means cut-from-cursor. */
#ifndef NANO_SMALL
-static bool concatenate_cut;
+static bool concatenate_cut = FALSE;
/* Should we add this cut string to the end of the last one? */
#endif
static filestruct *cutbottom = NULL;
assert(current != NULL && current->data != NULL);
- check_statblank();
+ check_statusblank();
if (!keep_cutbuffer) {
free_filestruct(cutbuffer);
#ifndef DISABLE_WRAPPING
wrap_reset();
#endif
- check_statblank();
+ check_statusblank();
if (cutbuffer == NULL || current == NULL)
return; /* AIEEEEEEEEEEEE */
char *ans = mallocstrcpy(NULL, "");
/* The last answer the user typed on the statusbar. Saved for if
* they do M-F or cancel the file browser. */
+#ifndef NANO_SMALL
+ bool extcmd = FALSE;
+#endif
wrap_reset();
#if !defined(DISABLE_BROWSER) || (!defined(NANO_SMALL) && defined(ENABLE_MULTIBUFFER))
- start_again: /* Go here when the user cancels the file browser. */
+ start_again:
#endif
+#ifndef NANO_SMALL
+ if (extcmd) {
#ifdef ENABLE_MULTIBUFFER
- if (ISSET(MULTIBUFFER))
- msg = N_("File to insert into new buffer [from %s] ");
- else
+ if (ISSET(MULTIBUFFER))
+ msg = N_("Command to execute in new buffer [from %s] ");
+ else
+#endif
+ msg = N_("Command to execute [from %s] ");
+ } else {
+#endif
+#ifdef ENABLE_MULTIBUFFER
+ if (ISSET(MULTIBUFFER)) {
+ msg = N_("File to insert into new buffer [from %s] ");
+ } else
+#endif
+ msg = N_("File to insert [from %s] ");
+#ifndef NANO_SMALL
+ }
#endif
- msg = N_("File to insert [from %s] ");
- i = statusq(TRUE, insertfile_list, ans,
+ i = statusq(TRUE,
+#ifndef NANO_SMALL
+ extcmd ? extcmd_list :
+#endif
+ insertfile_list, ans,
#ifndef NANO_SMALL
NULL,
#endif
ans = mallocstrcpy(ans, answer);
-#ifndef NANO_SMALL
-#ifdef ENABLE_MULTIBUFFER
+#if !defined(NANO_SMALL) && defined(ENABLE_MULTIBUFFER)
if (i == TOGGLE_MULTIBUFFER_KEY) {
/* Don't allow toggling if we're in view mode. */
if (!ISSET(VIEW_MODE))
TOGGLE(MULTIBUFFER);
goto start_again;
}
-#endif /* ENABLE_MULTIBUFFER */
- if (i == NANO_EXTCMD_KEY) {
- int j;
-
-#ifdef ENABLE_MULTIBUFFER
- exec_again: /* Go here when the user toggles multibuffer mode. */
-
- if (ISSET(MULTIBUFFER))
- msg = N_("Command to execute in new buffer");
- else
-#endif
- msg = N_("Command to execute");
-
- j = statusq(TRUE, extcmd_list, ans, NULL, _(msg));
-
-#ifdef ENABLE_MULTIBUFFER
- if (j == TOGGLE_MULTIBUFFER_KEY) {
- /* Don't allow toggling if we're in view mode. */
- if (!ISSET(VIEW_MODE)) {
- TOGGLE(MULTIBUFFER);
- ans = mallocstrcpy(NULL, answer);
- }
- goto exec_again;
- }
#endif
- if (j == -1 || answer == NULL || answer[0] == '\0')
- goto start_again;
- }
-#endif /* !NANO_SMALL */
#ifndef DISABLE_BROWSER
if (i == NANO_TOFILES_KEY) {
char *tmp = do_browse_from(answer);
if (tmp == NULL)
goto start_again;
- resetstatuspos = TRUE;
free(answer);
answer = tmp;
}
#endif
#ifndef NANO_SMALL
- if (i == NANO_EXTCMD_KEY)
+ if (i == NANO_TOOTHERINSERT_KEY) {
+ extcmd = !extcmd;
+ goto start_again;
+ }
+
+ if (extcmd)
execute_command(answer);
else {
#endif
}
#endif
- /* If we've gone off the bottom, recenter; otherwise, just redraw */
+ /* Refresh the screen. */
edit_refresh();
} else
statusbar(_("Cancelled"));
char *new_path;
/* Used by the Go To Directory prompt. */
- check_statblank();
+ check_statusblank();
#if !defined(DISABLE_HELP) || !defined(DISABLE_MOUSE)
currshortcut = browser_list;
return do_browser(path);
/* Go to a specific directory */
- case NANO_GOTO_KEY:
- case NANO_GOTO_FKEY:
+ case NANO_GOTOLINE_KEY:
+ case NANO_GOTOLINE_FKEY:
case 'G': /* Pico compatibility */
case 'g':
curs_set(1);
char *backup_dir = NULL; /* Backup directory. */
#endif
-bool resetstatuspos; /* Hack for resetting the status bar
- cursor position */
char *answer = NULL; /* Answer str to many questions */
int totlines = 0; /* Total number of lines in the file */
long totsize = 0; /* Total number of bytes in the file */
shortcut *whereis_list = NULL;
shortcut *replace_list = NULL;
shortcut *replace_list_2 = NULL; /* 2nd half of replace dialog */
-shortcut *goto_list = NULL;
+shortcut *gotoline_list = NULL;
shortcut *writefile_list = NULL;
shortcut *insertfile_list = NULL;
#ifndef DISABLE_HELP
N_("Uncut from the cutbuffer into the current line");
const char *nano_cursorpos_msg = N_("Show the position of the cursor");
const char *nano_spell_msg = N_("Invoke the spell checker, if available");
- const char *nano_goto_msg = N_("Go to a specific line number");
+ const char *nano_gotoline_msg = N_("Go to a specific line number");
const char *nano_replace_msg = N_("Replace text within the editor");
const char *nano_prevline_msg = N_("Move to the previous line");
const char *nano_nextline_msg = N_("Move to the next line");
#endif
nano_disabled_msg);
- sc_init_one(&main_list, NANO_GOTO_KEY, go_to_line_msg,
- IFHELP(nano_goto_msg, NANO_ALT_GOTO_KEY), NANO_GOTO_FKEY,
+ sc_init_one(&main_list, NANO_GOTOLINE_KEY, go_to_line_msg,
+ IFHELP(nano_gotoline_msg, NANO_GOTOLINE_ALTKEY), NANO_GOTOLINE_FKEY,
NANO_NO_KEY, VIEW, do_gotoline_void);
sc_init_one(&main_list, NANO_REPLACE_KEY, replace_msg,
NANO_NO_KEY, VIEW, total_refresh);
sc_init_one(&main_list, NANO_MARK_KEY, N_("Mark Text"),
- IFHELP(nano_mark_msg, NANO_ALT_MARK_KEY),
+ IFHELP(nano_mark_msg, NANO_MARK_ALTKEY),
NANO_NO_KEY, NANO_NO_KEY, NOVIEW,
#ifndef NANO_SMALL
do_mark
NANO_NO_KEY, VIEW, do_last_line);
/* Translators: try to keep this string under 10 characters long */
- sc_init_one(&whereis_list, NANO_OTHERSEARCH_KEY, replace_msg,
+ sc_init_one(&whereis_list, NANO_TOOTHERSEARCH_KEY, replace_msg,
IFHELP(nano_replace_msg, NANO_NO_KEY), NANO_REPLACE_FKEY,
NANO_NO_KEY, VIEW, do_replace);
/* Translators: try to keep this string under 10 characters long */
- sc_init_one(&whereis_list, NANO_FROMSEARCHTOGOTO_KEY, go_to_line_msg,
- IFHELP(nano_goto_msg, NANO_NO_KEY), NANO_GOTO_FKEY,
+ sc_init_one(&whereis_list, NANO_TOGOTOLINE_KEY, go_to_line_msg,
+ IFHELP(nano_gotoline_msg, NANO_NO_KEY), NANO_GOTOLINE_FKEY,
NANO_NO_KEY, VIEW, do_gotoline_void);
#ifndef DISABLE_JUSTIFY
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&whereis_list, NANO_PARABEGIN_KEY, beg_of_par_msg,
- IFHELP(nano_parabegin_msg, NANO_NO_KEY), NANO_NO_KEY,
- NANO_NO_KEY, VIEW, do_para_begin);
+ IFHELP(nano_parabegin_msg, NANO_PARABEGIN_ALTKEY1), NANO_NO_KEY,
+ NANO_PARABEGIN_ALTKEY2, VIEW, do_para_begin);
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&whereis_list, NANO_PARAEND_KEY, end_of_par_msg,
- IFHELP(nano_paraend_msg, NANO_NO_KEY), NANO_NO_KEY,
- NANO_NO_KEY, VIEW, do_para_end);
+ IFHELP(nano_paraend_msg, NANO_PARAEND_ALTKEY1), NANO_NO_KEY,
+ NANO_PARAEND_ALTKEY2, VIEW, do_para_end);
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&whereis_list, NANO_FULLJUSTIFY_KEY, fulljstify_msg,
- IFHELP(nano_fulljustify_msg, NANO_NO_KEY), NANO_NO_KEY,
+ IFHELP(nano_fulljustify_msg, NANO_FULLJUSTIFY_ALTKEY), NANO_NO_KEY,
NANO_NO_KEY, NOVIEW, do_full_justify);
#endif
NANO_NO_KEY, VIEW, do_last_line);
/* Translators: try to keep this string under 12 characters long */
- sc_init_one(&replace_list, NANO_OTHERSEARCH_KEY, N_("No Replace"),
+ sc_init_one(&replace_list, NANO_TOOTHERSEARCH_KEY, N_("No Replace"),
IFHELP(nano_whereis_msg, NANO_NO_KEY), NANO_REPLACE_FKEY,
NANO_NO_KEY, VIEW, do_search);
- sc_init_one(&replace_list, NANO_FROMSEARCHTOGOTO_KEY, go_to_line_msg,
- IFHELP(nano_goto_msg, NANO_NO_KEY), NANO_GOTO_FKEY,
+ sc_init_one(&replace_list, NANO_TOGOTOLINE_KEY, go_to_line_msg,
+ IFHELP(nano_gotoline_msg, NANO_NO_KEY), NANO_GOTOLINE_FKEY,
NANO_NO_KEY, VIEW, do_gotoline_void);
#ifndef NANO_SMALL
NANO_NO_KEY, VIEW, 0);
#endif
- free_shortcutage(&goto_list);
+ free_shortcutage(&gotoline_list);
- sc_init_one(&goto_list, NANO_HELP_KEY, get_help_msg,
+ sc_init_one(&gotoline_list, NANO_HELP_KEY, get_help_msg,
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY,
NANO_NO_KEY, VIEW,
#ifndef DISABLE_HELP
#endif
);
- sc_init_one(&goto_list, NANO_CANCEL_KEY, cancel_msg,
+ sc_init_one(&gotoline_list, NANO_CANCEL_KEY, cancel_msg,
IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, 0);
- sc_init_one(&goto_list, NANO_FIRSTLINE_KEY, first_line_msg,
+ sc_init_one(&gotoline_list, NANO_FIRSTLINE_KEY, first_line_msg,
IFHELP(nano_firstline_msg, NANO_NO_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, do_first_line);
- sc_init_one(&goto_list, NANO_LASTLINE_KEY, last_line_msg,
+ sc_init_one(&gotoline_list, NANO_LASTLINE_KEY, last_line_msg,
IFHELP(nano_lastline_msg, NANO_NO_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, do_last_line);
+ sc_init_one(&gotoline_list, NANO_TOOTHERWHEREIS_KEY, N_("Go To Text"),
+ IFHELP(nano_whereis_msg, NANO_NO_KEY), NANO_NO_KEY,
+ NANO_NO_KEY, VIEW, do_search);
+
#ifndef DISABLE_HELP
free_shortcutage(&help_list);
* It's useless since inserting files is disabled. */
/* Translators: try to keep this string under 22 characters long */
if (!ISSET(RESTRICTED))
- sc_init_one(&insertfile_list, NANO_EXTCMD_KEY, N_("Execute Command"),
+ sc_init_one(&insertfile_list, NANO_TOOTHERINSERT_KEY, N_("Execute Command"),
IFHELP(nano_execute_msg, NANO_NO_KEY), NANO_NO_KEY,
NANO_NO_KEY, NOVIEW, 0);
IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, 0);
+ sc_init_one(&extcmd_list, NANO_TOOTHERINSERT_KEY, N_("Insert File"),
+ IFHELP(nano_insert_msg, NANO_NO_KEY), NANO_NO_KEY,
+ NANO_NO_KEY, VIEW, 0);
+
#ifdef ENABLE_MULTIBUFFER
sc_init_one(&extcmd_list, NANO_NO_KEY, new_buffer_msg,
IFHELP(nano_multibuffer_msg, TOGGLE_MULTIBUFFER_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, 0);
/* Translators: try to keep this string under 22 characters long */
- sc_init_one(&browser_list, NANO_GOTO_KEY, N_("Go To Dir"),
- IFHELP(nano_gotodir_msg, NANO_ALT_GOTO_KEY), NANO_GOTO_FKEY,
+ sc_init_one(&browser_list, NANO_GOTOLINE_KEY, N_("Go To Dir"),
+ IFHELP(nano_gotodir_msg, NANO_GOTOLINE_ALTKEY), NANO_GOTOLINE_FKEY,
NANO_NO_KEY, VIEW, 0);
free_shortcutage(&gotodir_list);
free_shortcutage(&whereis_list);
free_shortcutage(&replace_list);
free_shortcutage(&replace_list_2);
- free_shortcutage(&goto_list);
+ free_shortcutage(&gotoline_list);
free_shortcutage(&writefile_list);
free_shortcutage(&insertfile_list);
#ifndef DISABLE_HELP
#ifndef NANO_SMALL
}
#endif
- check_statblank();
+ check_statusblank();
if (need_horizontal_update(old_pww))
update_line(current, current_x);
}
size_t old_pww = placewewant;
current_x = strlen(current->data);
placewewant = xplustabs();
- check_statblank();
+ check_statusblank();
if (need_horizontal_update(old_pww))
update_line(current, current_x);
}
/* Update all the lines that need to be updated. */
edit_redraw(old_current, old_pww);
- check_statblank();
+ check_statusblank();
}
void do_page_down(void)
/* Update all the lines that need to be updated. */
edit_redraw(old_current, old_pww);
- check_statblank();
+ check_statusblank();
}
void do_up(void)
#ifndef DISABLE_WRAPPING
wrap_reset();
#endif
- check_statblank();
+ check_statusblank();
if (current->prev == NULL)
return;
#ifndef DISABLE_WRAPPING
wrap_reset();
#endif
- check_statblank();
+ check_statusblank();
if (current->next == NULL)
return;
current_x = strlen(current->data);
}
placewewant = xplustabs();
- check_statblank();
+ check_statusblank();
if (allow_update && need_horizontal_update(old_pww))
update_line(current, current_x);
}
current_x = 0;
}
placewewant = xplustabs();
- check_statblank();
+ check_statusblank();
if (allow_update && need_horizontal_update(old_pww))
update_line(current, current_x);
}
"the Search: prompt. Hitting Enter without entering any text "
"will perform the previous search.\n\n The following function "
"keys are available in Search mode:\n\n");
- else if (currshortcut == goto_list)
+ else if (currshortcut == gotoline_list)
htx = N_("Go To Line Help Text\n\n "
"Enter the line number that you wish to go to and hit "
"Enter. If there are fewer lines of text than the "
/* Normal keys. */
#define NANO_XON_KEY NANO_CONTROL_Q
#define NANO_XOFF_KEY NANO_CONTROL_S
-#define NANO_INSERTFILE_KEY NANO_CONTROL_R
-#define NANO_INSERTFILE_FKEY KEY_F(5)
+#define NANO_CANCEL_KEY NANO_CONTROL_C
#define NANO_EXIT_KEY NANO_CONTROL_X
#define NANO_EXIT_FKEY KEY_F(2)
+#define NANO_INSERTFILE_KEY NANO_CONTROL_R
+#define NANO_INSERTFILE_FKEY KEY_F(5)
+#define NANO_TOOTHERINSERT_KEY NANO_CONTROL_X
#define NANO_WRITEOUT_KEY NANO_CONTROL_O
#define NANO_WRITEOUT_FKEY KEY_F(3)
-#define NANO_GOTO_KEY NANO_CONTROL_7
-#define NANO_GOTO_FKEY KEY_F(13)
-#define NANO_ALT_GOTO_KEY NANO_ALT_G
+#define NANO_GOTOLINE_KEY NANO_CONTROL_7
+#define NANO_GOTOLINE_FKEY KEY_F(13)
+#define NANO_GOTOLINE_ALTKEY NANO_ALT_G
+#define NANO_TOGOTOLINE_KEY NANO_CONTROL_T
#define NANO_HELP_KEY NANO_CONTROL_G
#define NANO_HELP_FKEY KEY_F(1)
#define NANO_WHEREIS_KEY NANO_CONTROL_W
#define NANO_WHEREIS_FKEY KEY_F(6)
#define NANO_WHEREIS_NEXT_KEY NANO_ALT_W
+#define NANO_TOOTHERWHEREIS_KEY NANO_CONTROL_T
#define NANO_REPLACE_KEY NANO_CONTROL_4
#define NANO_REPLACE_FKEY KEY_F(14)
#define NANO_ALT_REPLACE_KEY NANO_ALT_R
-#define NANO_OTHERSEARCH_KEY NANO_CONTROL_R
+#define NANO_TOOTHERSEARCH_KEY NANO_CONTROL_R
#define NANO_PREVPAGE_KEY NANO_CONTROL_Y
#define NANO_PREVPAGE_FKEY KEY_F(7)
#define NANO_NEXTPAGE_KEY NANO_CONTROL_V
#define NANO_FIRSTLINE_FKEY NANO_PREVPAGE_FKEY
#define NANO_LASTLINE_KEY NANO_NEXTPAGE_KEY
#define NANO_LASTLINE_FKEY NANO_NEXTPAGE_FKEY
-#define NANO_CANCEL_KEY NANO_CONTROL_C
#define NANO_REFRESH_KEY NANO_CONTROL_L
#define NANO_JUSTIFY_KEY NANO_CONTROL_J
#define NANO_JUSTIFY_FKEY KEY_F(4)
#define NANO_FORWARD_KEY NANO_CONTROL_F
#define NANO_BACK_KEY NANO_CONTROL_B
#define NANO_MARK_KEY NANO_CONTROL_6
-#define NANO_ALT_MARK_KEY NANO_ALT_A
+#define NANO_MARK_ALTKEY NANO_ALT_A
#define NANO_HOME_KEY NANO_CONTROL_A
#define NANO_END_KEY NANO_CONTROL_E
#define NANO_DELETE_KEY NANO_CONTROL_D
#define NANO_TAB_KEY NANO_CONTROL_I
#define NANO_SUSPEND_KEY NANO_CONTROL_Z
#define NANO_ENTER_KEY NANO_CONTROL_M
-#define NANO_FROMSEARCHTOGOTO_KEY NANO_CONTROL_T
#define NANO_TOFILES_KEY NANO_CONTROL_T
#define NANO_APPEND_KEY NANO_ALT_A
#define NANO_PREPEND_KEY NANO_ALT_P
#define NANO_OPENPREV_ALTKEY NANO_ALT_COMMA
#define NANO_OPENNEXT_ALTKEY NANO_ALT_PERIOD
#define NANO_BRACKET_KEY NANO_ALT_RBRACKET
-#define NANO_EXTCMD_KEY NANO_CONTROL_X
#define NANO_NEXTWORD_KEY NANO_CONTROL_SPACE
#define NANO_PREVWORD_KEY NANO_ALT_SPACE
#define NANO_PARABEGIN_KEY NANO_CONTROL_W
extern shortcut *shortcut_list;
extern shortcut *main_list, *whereis_list;
-extern shortcut *replace_list, *goto_list;
+extern shortcut *replace_list, *gotoline_list;
extern shortcut *writefile_list, *insertfile_list;
extern shortcut *replace_list_2;
#ifndef NANO_SMALL
void blank_titlebar(void);
void blank_edit(void);
void blank_statusbar(void);
-void check_statblank(void);
+void check_statusblank(void);
void blank_bottombars(void);
char *display_string(const char *buf, size_t start_col, size_t len);
void nanoget_repaint(const char *buf, const char *inputbuf, size_t x);
return 1;
#endif
#endif /* !NANO_SMALL */
- case NANO_OTHERSEARCH_KEY:
+ case NANO_TOOTHERSEARCH_KEY:
backupstring = mallocstrcpy(backupstring, answer);
return -2; /* Call the opposite search function. */
- case NANO_FROMSEARCHTOGOTO_KEY:
+ case NANO_TOGOTOLINE_KEY:
#ifndef NANO_SMALL
search_history.current = search_history.next;
#endif
#ifndef DISABLE_WRAPPING
wrap_reset();
#endif
+
i = search_init(FALSE);
if (i == -1) /* Cancel, Go to Line, blank search string, or
* regcomp() failed. */
{
if (line <= 0) { /* Ask for it. */
char *ans = mallocstrcpy(NULL, answer);
- int st = statusq(FALSE, goto_list, line < 0 ? ans : "",
+ int i = statusq(FALSE, gotoline_list, line < 0 ? ans : "",
#ifndef NANO_SMALL
NULL,
#endif
free(ans);
/* Cancel, or Enter with blank string. */
- if (st == -1 || st == -2)
+ if (i == -1 || i == -2)
statusbar(_("Cancelled"));
- if (st != 0) {
+
+ if (i == NANO_TOOTHERWHEREIS_KEY) {
+ do_search();
+ return;
+ }
+
+ if (i != 0) {
display_main_list();
return;
}
#include "proto.h"
#include "nano.h"
-static int statblank = 0; /* Number of keystrokes left after
- we call statusbar(), before we
- actually blank the statusbar */
+static int statusblank = 0; /* Number of keystrokes left after
+ * we call statusbar(), before we
+ * actually blank the statusbar. */
+static bool resetstatuspos = FALSE;
+ /* Should we reset the statusbar cursor
+ * position? */
/* Control character compatibility:
*
mvwaddstr(bottomwin, 0, 0, hblank);
}
-void check_statblank(void)
+void check_statusblank(void)
{
- if (statblank > 1)
- statblank--;
- else if (statblank == 1 && !ISSET(CONSTUPDATE)) {
- statblank = 0;
+ if (statusblank > 1)
+ statusblank--;
+ else if (statusblank == 1 && !ISSET(CONSTUPDATE)) {
+ statusblank = 0;
blank_statusbar();
wnoutrefresh(bottomwin);
reset_cursor();
* disable all keys that would change the text if the filename isn't
* blank and we're at the "Write File" prompt. */
while ((kbinput = get_kbinput(bottomwin, &meta_key, &func_key)) !=
- NANO_ENTER_KEY) {
+ NANO_CANCEL_KEY && kbinput != NANO_ENTER_KEY) {
for (t = s; t != NULL; t = t->next) {
#ifdef DEBUG
fprintf(stderr, "Aha! \'%c\' (%d)\n", kbinput, kbinput);
/* We finished putting in an answer; reset x */
x = -1;
- /* Just check for a blank answer here */
- if (answer[0] == '\0')
- return -2;
- else
- return 0;
+ return kbinput;
}
void titlebar(const char *path)
}
SET(DISABLE_CURPOS);
- statblank = 26;
+ statusblank = 26;
}
void bottombars(const shortcut *s)
break;
#ifndef DISABLE_JUSTIFY
case NANO_PARABEGIN_KEY:
+ case NANO_PARABEGIN_ALTKEY1:
+ case NANO_PARABEGIN_ALTKEY2:
do_para_begin();
resetstatuspos = TRUE;
break;
case NANO_PARAEND_KEY:
+ case NANO_PARAEND_ALTKEY1:
+ case NANO_PARAEND_ALTKEY2:
do_para_end();
resetstatuspos = TRUE;
break;
case NANO_FULLJUSTIFY_KEY:
+ case NANO_FULLJUSTIFY_ALTKEY:
if (!ISSET(VIEW_MODE))
do_full_justify();
resetstatuspos = TRUE;
ret = -1;
resetstatuspos = TRUE;
break;
+ case NANO_ENTER_KEY:
+ ret = (answer[0] == '\0') ? -2 : 0;
+ resetstatuspos = TRUE;
+ break;
}
blank_statusbar();