2000-06-06 05:53:49 +00:00
|
|
|
/**************************************************************************
|
2016-09-03 12:14:08 +02:00
|
|
|
* global.c -- This file is part of GNU nano. *
|
2000-06-06 05:53:49 +00:00
|
|
|
* *
|
2019-02-24 19:32:17 +01:00
|
|
|
* Copyright (C) 1999-2011, 2013-2019 Free Software Foundation, Inc. *
|
2019-03-10 16:29:57 +01:00
|
|
|
* Copyright (C) 2014-2019 Benno Schulenberg *
|
2016-08-29 15:14:18 +02:00
|
|
|
* *
|
2016-08-29 17:10:49 +02:00
|
|
|
* GNU nano is free software: you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published *
|
|
|
|
* by the Free Software Foundation, either version 3 of the License, *
|
|
|
|
* or (at your option) any later version. *
|
2000-06-06 05:53:49 +00:00
|
|
|
* *
|
2016-08-29 17:10:49 +02:00
|
|
|
* GNU nano is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty *
|
|
|
|
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
|
|
|
* See the GNU General Public License for more details. *
|
2000-06-06 05:53:49 +00:00
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
2016-08-29 17:10:49 +02:00
|
|
|
* along with this program. If not, see http://www.gnu.org/licenses/. *
|
2000-06-06 05:53:49 +00:00
|
|
|
* *
|
|
|
|
**************************************************************************/
|
|
|
|
|
2008-07-12 02:13:22 +00:00
|
|
|
#include "proto.h"
|
|
|
|
|
2008-03-05 07:34:01 +00:00
|
|
|
#include <ctype.h>
|
2008-03-12 04:44:14 +00:00
|
|
|
#include <string.h>
|
2008-03-05 07:34:01 +00:00
|
|
|
#include <strings.h>
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2006-05-10 13:41:53 +00:00
|
|
|
/* Global variables. */
|
|
|
|
#ifndef NANO_TINY
|
2016-12-14 20:37:03 +01:00
|
|
|
volatile sig_atomic_t the_window_resized = FALSE;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* Set to TRUE by the handler whenever a SIGWINCH occurs. */
|
2006-05-10 13:41:53 +00:00
|
|
|
#endif
|
|
|
|
|
2019-05-13 12:50:31 +02:00
|
|
|
bool on_a_vt = FALSE;
|
|
|
|
/* Whether we're running on a Linux console (a VT). */
|
2016-08-11 12:37:11 +02:00
|
|
|
|
2014-06-30 18:04:33 +00:00
|
|
|
bool meta_key;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* Whether the current keystroke is a Meta key. */
|
2016-04-24 11:28:28 +02:00
|
|
|
bool shift_held;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* Whether Shift was being held together with a movement key. */
|
2016-04-12 10:24:57 +02:00
|
|
|
bool focusing = TRUE;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* Whether an update of the edit window should center the cursor. */
|
2016-05-19 20:43:08 +02:00
|
|
|
|
2016-12-20 19:27:41 +01:00
|
|
|
bool as_an_at = TRUE;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* Whether a 0x0A byte should be shown as a ^@ instead of a ^J. */
|
2016-12-20 19:27:41 +01:00
|
|
|
|
2019-05-26 13:10:47 +02:00
|
|
|
bool control_C_was_pressed = FALSE;
|
|
|
|
/* Whether Ctrl+C was pressed (when a keyboard interrupt is enabled). */
|
|
|
|
|
2019-06-03 13:38:21 +02:00
|
|
|
bool started_curses = FALSE;
|
|
|
|
|
2017-05-29 22:06:59 +02:00
|
|
|
bool suppress_cursorpos = FALSE;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* Should we skip constant position display for current keystroke? */
|
2017-05-29 22:06:59 +02:00
|
|
|
|
2016-05-19 20:43:08 +02:00
|
|
|
message_type lastmessage = HUSH;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* Messages of type HUSH should not overwrite type MILD nor ALERT. */
|
2014-06-30 18:04:33 +00:00
|
|
|
|
2019-03-21 17:08:52 +01:00
|
|
|
linestruct *pletion_line = NULL;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The line where the last completion was found, if any. */
|
2016-12-07 09:43:47 +05:30
|
|
|
|
2017-04-22 21:57:01 +05:30
|
|
|
bool inhelp = FALSE;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* Whether we are in the help viewer. */
|
2017-04-22 21:57:01 +05:30
|
|
|
char *title = NULL;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* When not NULL: the title of the current help text. */
|
2017-04-22 21:57:01 +05:30
|
|
|
|
2017-09-12 21:35:35 +02:00
|
|
|
bool more_than_one = FALSE;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* Whether more than one buffer is or has been open. */
|
2017-12-24 12:26:55 +01:00
|
|
|
bool also_the_last = FALSE;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* Whether indenting/commenting should include the last line of
|
|
|
|
* the marked region. */
|
2019-06-28 20:07:42 +02:00
|
|
|
bool is_shorter;
|
|
|
|
/* Whether a row's text is narrower than the screen's width. */
|
|
|
|
|
2017-05-03 12:41:24 +02:00
|
|
|
int didfind = 0;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* Whether the last search found something. */
|
2017-05-03 12:41:24 +02:00
|
|
|
|
2018-10-07 10:24:19 +02:00
|
|
|
int controlleft, controlright, controlup, controldown;
|
|
|
|
int controlhome, controlend;
|
2016-09-08 21:00:51 +02:00
|
|
|
#ifndef NANO_TINY
|
2018-10-15 08:28:29 -05:00
|
|
|
int controldelete, controlshiftdelete;
|
2018-10-05 19:50:41 +02:00
|
|
|
int shiftleft, shiftright, shiftup, shiftdown;
|
2016-04-24 11:28:28 +02:00
|
|
|
int shiftcontrolleft, shiftcontrolright, shiftcontrolup, shiftcontroldown;
|
2017-04-05 11:22:35 +02:00
|
|
|
int shiftcontrolhome, shiftcontrolend;
|
2017-08-11 15:23:56 +03:00
|
|
|
int altleft, altright, altup, altdown;
|
2018-10-24 03:17:28 -06:00
|
|
|
int altdelete;
|
2016-04-24 11:28:28 +02:00
|
|
|
int shiftaltleft, shiftaltright, shiftaltup, shiftaltdown;
|
2015-11-23 08:52:23 +00:00
|
|
|
#endif
|
|
|
|
|
2017-10-31 17:39:30 +01:00
|
|
|
#ifdef ENABLED_WRAPORJUSTIFY
|
2018-10-22 18:01:23 -05:00
|
|
|
ssize_t fill = -COLUMNS_FROM_EOL;
|
2018-10-17 18:01:01 -05:00
|
|
|
/* The relative column where we will wrap lines. */
|
2019-09-30 19:30:54 +02:00
|
|
|
size_t wrap_at = 0;
|
2018-10-22 18:01:23 -05:00
|
|
|
/* The actual column where we will wrap lines, based on fill. */
|
2005-12-08 07:09:08 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
char *last_search = NULL;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The last string we searched for. */
|
2005-12-08 07:09:08 +00:00
|
|
|
|
2016-04-30 21:22:16 +02:00
|
|
|
char *present_path = NULL;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The current browser directory when trying to do tab completion. */
|
2016-04-30 21:22:16 +02:00
|
|
|
|
2009-08-14 03:18:29 +00:00
|
|
|
unsigned flags[4] = {0, 0, 0, 0};
|
2017-12-29 19:27:33 +01:00
|
|
|
/* Our flag containing the states of all global options. */
|
2018-04-01 20:11:44 +02:00
|
|
|
|
2017-05-18 10:16:52 +02:00
|
|
|
WINDOW *topwin = NULL;
|
2018-04-01 20:11:44 +02:00
|
|
|
/* The top portion of the screen, showing the version number of nano,
|
|
|
|
* the name of the file, and whether the buffer was modified. */
|
2017-05-18 10:16:52 +02:00
|
|
|
WINDOW *edit = NULL;
|
2018-04-01 20:11:44 +02:00
|
|
|
/* The middle portion of the screen: the edit window, showing the
|
|
|
|
* contents of the current buffer, the file we are editing. */
|
2017-05-18 10:16:52 +02:00
|
|
|
WINDOW *bottomwin = NULL;
|
2018-04-01 20:11:44 +02:00
|
|
|
/* The bottom portion of the screen, where we display statusbar
|
2017-12-29 19:27:33 +01:00
|
|
|
* messages, the statusbar prompt, and a list of shortcuts. */
|
2005-12-08 07:09:08 +00:00
|
|
|
int editwinrows = 0;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* How many rows does the edit window take up? */
|
2018-04-01 19:53:51 +02:00
|
|
|
int editwincols = -1;
|
|
|
|
/* The number of usable columns in the edit window: COLS - margin. */
|
|
|
|
int margin = 0;
|
|
|
|
/* The amount of space reserved at the left for line numbers. */
|
2019-03-14 19:32:10 +01:00
|
|
|
#ifndef NANO_TINY
|
2018-12-17 19:57:30 +01:00
|
|
|
ssize_t stripe_column = 0;
|
|
|
|
/* The column at which a vertical bar will be drawn. */
|
2019-03-14 19:32:10 +01:00
|
|
|
#endif
|
2005-12-08 07:09:08 +00:00
|
|
|
|
2019-03-21 17:08:52 +01:00
|
|
|
linestruct *cutbuffer = NULL;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The buffer where we store cut text. */
|
2019-03-21 17:08:52 +01:00
|
|
|
linestruct *cutbottom = NULL;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The last line in the cutbuffer. */
|
2018-12-30 13:36:29 +01:00
|
|
|
bool keep_cutbuffer = FALSE;
|
|
|
|
/* Whether to add to the cutbuffer instead of clearing it first. */
|
|
|
|
|
2005-07-08 19:57:25 +00:00
|
|
|
openfilestruct *openfile = NULL;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The list of all open file buffers. */
|
2019-04-22 19:45:42 +02:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
|
|
|
openfilestruct *startfile = NULL;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The first open buffer. */
|
2019-04-22 19:45:42 +02:00
|
|
|
#endif
|
2001-07-11 02:08:33 +00:00
|
|
|
|
2006-01-06 21:51:10 +00:00
|
|
|
#ifndef NANO_TINY
|
|
|
|
char *matchbrackets = NULL;
|
2018-11-05 09:38:07 +01:00
|
|
|
/* The opening and closing brackets that bracket searches can find. */
|
2005-12-08 07:09:08 +00:00
|
|
|
char *whitespace = NULL;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The characters used when visibly showing tabs and spaces. */
|
2019-03-21 19:21:45 +01:00
|
|
|
int whitelen[2];
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The length in bytes of these characters. */
|
2004-05-29 16:47:52 +00:00
|
|
|
#endif
|
|
|
|
|
2017-10-31 17:34:07 +01:00
|
|
|
#ifdef ENABLE_JUSTIFY
|
2005-12-08 07:09:08 +00:00
|
|
|
char *punct = NULL;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The closing punctuation that can end sentences. */
|
2005-12-08 07:09:08 +00:00
|
|
|
char *brackets = NULL;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The closing brackets that can follow closing punctuation and
|
|
|
|
* can end sentences. */
|
2005-12-08 07:09:08 +00:00
|
|
|
char *quotestr = NULL;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The quoting string. The default value is set in main(). */
|
2005-12-08 07:09:08 +00:00
|
|
|
regex_t quotereg;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The compiled regular expression from the quoting string. */
|
2017-10-31 17:34:07 +01:00
|
|
|
#endif
|
2004-02-28 16:24:31 +00:00
|
|
|
|
2016-06-30 18:02:45 +02:00
|
|
|
char *word_chars = NULL;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* Nonalphanumeric characters that also form words. */
|
2016-06-30 18:02:45 +02:00
|
|
|
|
2005-12-08 07:09:08 +00:00
|
|
|
char *answer = NULL;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The answer string used by the statusbar prompt. */
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2005-12-08 07:09:08 +00:00
|
|
|
ssize_t tabsize = -1;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The width of a tab in spaces. The default is set in main(). */
|
2000-08-03 22:51:21 +00:00
|
|
|
|
2005-12-08 07:09:08 +00:00
|
|
|
#ifndef NANO_TINY
|
|
|
|
char *backup_dir = NULL;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The directory where we store backup files. */
|
2013-01-01 03:24:39 +00:00
|
|
|
|
2013-01-03 04:36:39 +00:00
|
|
|
const char *locking_prefix = ".";
|
2017-12-29 19:27:33 +01:00
|
|
|
/* Prefix of how to store the vim-style lock file. */
|
2013-01-03 04:36:39 +00:00
|
|
|
const char *locking_suffix = ".swp";
|
2017-12-29 19:27:33 +01:00
|
|
|
/* Suffix of the vim-style lock file. */
|
2005-12-08 07:09:08 +00:00
|
|
|
#endif
|
2017-10-29 21:08:07 +01:00
|
|
|
#ifdef ENABLE_OPERATINGDIR
|
2005-12-08 07:09:08 +00:00
|
|
|
char *operating_dir = NULL;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The path to our confining "operating" directory, when given. */
|
2001-09-19 03:19:43 +00:00
|
|
|
#endif
|
|
|
|
|
2017-10-31 19:32:42 +01:00
|
|
|
#ifdef ENABLE_SPELLER
|
2005-12-08 07:09:08 +00:00
|
|
|
char *alt_speller = NULL;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The command to use for the alternate spell checker. */
|
2001-04-18 04:28:54 +00:00
|
|
|
#endif
|
|
|
|
|
2017-11-01 19:45:33 +01:00
|
|
|
#ifdef ENABLE_COLOR
|
2002-12-22 16:30:00 +00:00
|
|
|
syntaxtype *syntaxes = NULL;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The global list of color syntaxes. */
|
2002-12-22 16:30:00 +00:00
|
|
|
char *syntaxstr = NULL;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The color syntax name specified on the command line. */
|
2017-11-26 18:01:02 +01:00
|
|
|
bool have_palette = FALSE;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* Whether the colors for the current syntax have been initialized. */
|
2001-04-30 11:28:46 +00:00
|
|
|
#endif
|
|
|
|
|
2016-04-25 21:14:18 +02:00
|
|
|
bool refresh_needed = FALSE;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* Did a command mangle enough of the buffer that we should
|
|
|
|
* repaint the screen? */
|
2009-02-06 03:41:02 +00:00
|
|
|
|
2016-05-08 12:01:33 +02:00
|
|
|
int currmenu = MMOST;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The currently active menu, initialized to a dummy value. */
|
2019-04-03 17:34:05 +02:00
|
|
|
keystruct *sclist = NULL;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The start of the shortcuts list. */
|
2019-04-03 17:11:24 +02:00
|
|
|
funcstruct *allfuncs = NULL;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The start of the functions list. */
|
2019-04-03 17:11:24 +02:00
|
|
|
funcstruct *tailfunc;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The last function in the list. */
|
2019-04-03 17:11:24 +02:00
|
|
|
funcstruct *exitfunc;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* A pointer to the special Exit/Close item. */
|
2008-03-05 07:34:01 +00:00
|
|
|
|
2019-03-21 17:08:52 +01:00
|
|
|
linestruct *search_history = NULL;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The current item in the list of strings that were searched for. */
|
2019-03-21 17:08:52 +01:00
|
|
|
linestruct *execute_history = NULL;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The current item in the list of commands that were run with ^R ^X. */
|
2019-03-21 17:08:52 +01:00
|
|
|
linestruct *replace_history = NULL;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The current item in the list of replace strings. */
|
2017-10-29 19:42:12 +01:00
|
|
|
#ifdef ENABLE_HISTORIES
|
2019-03-21 17:08:52 +01:00
|
|
|
linestruct *searchtop = NULL;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The oldest item in the list of search strings. */
|
2019-03-21 17:08:52 +01:00
|
|
|
linestruct *searchbot = NULL;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The newest item in the list of search strings. */
|
2017-09-17 17:16:36 +02:00
|
|
|
|
2019-03-21 17:08:52 +01:00
|
|
|
linestruct *replacetop = NULL;
|
|
|
|
linestruct *replacebot = NULL;
|
2017-09-17 17:16:36 +02:00
|
|
|
|
2019-03-21 17:08:52 +01:00
|
|
|
linestruct *executetop = NULL;
|
|
|
|
linestruct *executebot = NULL;
|
2003-01-05 20:41:21 +00:00
|
|
|
#endif
|
|
|
|
|
2005-12-08 07:09:08 +00:00
|
|
|
regex_t search_regexp;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The compiled regular expression to use in searches. */
|
2005-12-08 07:09:08 +00:00
|
|
|
regmatch_t regmatches[10];
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The match positions for parenthetical subexpressions, 10
|
|
|
|
* maximum, used in regular expression searches. */
|
2002-03-24 23:19:32 +00:00
|
|
|
|
2014-05-04 08:53:06 +00:00
|
|
|
int hilite_attribute = A_REVERSE;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The curses attribute we use to highlight something. */
|
2017-11-01 19:45:33 +01:00
|
|
|
#ifdef ENABLE_COLOR
|
2018-08-30 11:21:27 +03:00
|
|
|
colortype* color_combo[NUMBER_OF_ELEMENTS] = {NULL};
|
2018-01-15 16:07:24 +01:00
|
|
|
/* The color combinations for interface elements given in the rcfile. */
|
2014-05-03 18:24:45 +00:00
|
|
|
#endif
|
2018-08-30 11:21:27 +03:00
|
|
|
int interface_color_pair[NUMBER_OF_ELEMENTS] = {0};
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The processed color pairs for the interface elements. */
|
2003-02-03 03:32:08 +00:00
|
|
|
|
2005-12-08 07:09:08 +00:00
|
|
|
char *homedir = NULL;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The user's home directory, from $HOME or /etc/passwd. */
|
2017-10-27 23:15:06 +02:00
|
|
|
char *statedir = NULL;
|
2017-12-29 19:27:33 +01:00
|
|
|
/* The directory for nano's history files. */
|
2018-08-06 21:12:22 +02:00
|
|
|
|
2019-11-25 19:17:41 +01:00
|
|
|
#if defined(ENABLE_NANORC) || defined(ENABLE_HISTORIES)
|
2019-10-20 14:25:22 +02:00
|
|
|
char *startup_problem = NULL;
|
|
|
|
/* An error message (if any) about nanorc files or history files. */
|
2018-08-04 10:53:34 +02:00
|
|
|
#endif
|
2016-09-03 12:14:08 +02:00
|
|
|
|
2018-09-29 11:14:43 -05:00
|
|
|
bool spotlighted = FALSE;
|
|
|
|
/* Whether any text is spotlighted. */
|
|
|
|
size_t light_from_col = 0;
|
|
|
|
/* Where the spotlighted text starts. */
|
|
|
|
size_t light_to_col = 0;
|
|
|
|
/* Where the spotlighted text ends. */
|
|
|
|
|
2014-07-01 18:52:21 +00:00
|
|
|
/* To make the functions and shortcuts lists clearer. */
|
2017-12-29 21:35:14 +01:00
|
|
|
#define VIEW TRUE /* Is allowed in view mode. */
|
2014-07-01 18:52:21 +00:00
|
|
|
#define NOVIEW FALSE
|
2017-12-29 21:35:14 +01:00
|
|
|
#define BLANKAFTER TRUE /* A blank line after this one. */
|
2014-07-01 18:52:21 +00:00
|
|
|
#define TOGETHER FALSE
|
2018-10-12 19:55:18 +02:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
|
|
|
#define CAN_OPEN_OTHER_BUFFER TRUE
|
|
|
|
#else
|
|
|
|
#define CAN_OPEN_OTHER_BUFFER FALSE
|
|
|
|
#endif
|
2014-07-01 18:52:21 +00:00
|
|
|
|
2018-04-01 20:11:44 +02:00
|
|
|
/* Empty functions, for the most part corresponding to toggles. */
|
2011-02-07 14:45:56 +00:00
|
|
|
void case_sens_void(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
void regexp_void(void)
|
|
|
|
{
|
|
|
|
}
|
2014-05-13 20:51:19 +00:00
|
|
|
void backwards_void(void)
|
|
|
|
{
|
|
|
|
}
|
2017-05-08 14:23:47 +02:00
|
|
|
void flip_replace(void)
|
|
|
|
{
|
|
|
|
}
|
2018-02-04 10:34:39 +01:00
|
|
|
void flip_goto(void)
|
2011-02-07 14:45:56 +00:00
|
|
|
{
|
|
|
|
}
|
2017-05-08 19:08:23 +02:00
|
|
|
#ifdef ENABLE_BROWSER
|
2011-02-07 14:45:56 +00:00
|
|
|
void to_files_void(void)
|
|
|
|
{
|
|
|
|
}
|
2014-05-13 20:51:19 +00:00
|
|
|
void goto_dir_void(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
#endif
|
2017-05-08 12:57:15 +02:00
|
|
|
#ifndef NANO_TINY
|
2018-04-17 10:34:57 +02:00
|
|
|
void do_toggle_void(void)
|
|
|
|
{
|
|
|
|
}
|
2011-02-07 14:45:56 +00:00
|
|
|
void dos_format_void(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
void mac_format_void(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
void append_void(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
void prepend_void(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
void backup_file_void(void)
|
|
|
|
{
|
|
|
|
}
|
2017-05-08 14:23:47 +02:00
|
|
|
void flip_execute(void)
|
2015-12-23 16:34:44 +00:00
|
|
|
{
|
|
|
|
}
|
2018-05-15 22:20:11 -03:00
|
|
|
void flip_pipe(void)
|
|
|
|
{
|
|
|
|
}
|
2018-08-19 12:35:15 +02:00
|
|
|
void flip_convert(void)
|
|
|
|
{
|
|
|
|
}
|
2017-05-08 14:23:47 +02:00
|
|
|
#endif
|
2017-05-08 13:20:07 +02:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2017-05-08 14:23:47 +02:00
|
|
|
void flip_newbuffer(void)
|
2011-02-07 14:45:56 +00:00
|
|
|
{
|
|
|
|
}
|
2017-05-08 13:20:07 +02:00
|
|
|
#endif
|
2017-05-08 14:23:47 +02:00
|
|
|
void discard_buffer(void)
|
2011-02-07 14:45:56 +00:00
|
|
|
{
|
|
|
|
}
|
2018-04-17 10:34:57 +02:00
|
|
|
void do_cancel(void)
|
|
|
|
{
|
|
|
|
}
|
2011-02-07 14:45:56 +00:00
|
|
|
|
2019-10-03 17:19:29 +02:00
|
|
|
/* Add a function to the linked list of functions. */
|
|
|
|
void add_to_funcs(void (*func)(void), int menus, const char *desc,
|
|
|
|
const char *help, bool blank_after, bool viewok)
|
2008-03-05 07:34:01 +00:00
|
|
|
{
|
2019-04-03 17:11:24 +02:00
|
|
|
funcstruct *f = nmalloc(sizeof(funcstruct));
|
2017-12-29 19:27:33 +01:00
|
|
|
|
|
|
|
if (allfuncs == NULL)
|
|
|
|
allfuncs = f;
|
|
|
|
else
|
|
|
|
tailfunc->next = f;
|
|
|
|
tailfunc = f;
|
|
|
|
|
|
|
|
f->next = NULL;
|
2018-02-24 19:31:11 +01:00
|
|
|
f->func = func;
|
2017-12-29 19:27:33 +01:00
|
|
|
f->menus = menus;
|
|
|
|
f->desc = desc;
|
|
|
|
f->viewok = viewok;
|
2017-04-25 17:51:45 +02:00
|
|
|
#ifdef ENABLE_HELP
|
2017-12-29 19:27:33 +01:00
|
|
|
f->help = help;
|
|
|
|
f->blank_after = blank_after;
|
2008-03-05 07:34:01 +00:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2019-10-03 17:19:29 +02:00
|
|
|
/* Add a key combo to the linked list of shortcuts. */
|
2016-10-15 17:55:19 +02:00
|
|
|
void add_to_sclist(int menus, const char *scstring, const int keycode,
|
2017-12-29 19:27:33 +01:00
|
|
|
void (*func)(void), int toggle)
|
2000-06-06 05:53:49 +00:00
|
|
|
{
|
2019-04-03 17:34:05 +02:00
|
|
|
static keystruct *tailsc;
|
2016-09-01 09:36:47 +02:00
|
|
|
#ifndef NANO_TINY
|
2017-12-29 19:27:33 +01:00
|
|
|
static int counter = 0;
|
2016-09-01 09:36:47 +02:00
|
|
|
#endif
|
2019-04-03 17:34:05 +02:00
|
|
|
keystruct *s = nmalloc(sizeof(keystruct));
|
2002-02-15 19:17:02 +00:00
|
|
|
|
2017-12-29 19:27:33 +01:00
|
|
|
/* Start the list, or tack on the next item. */
|
|
|
|
if (sclist == NULL)
|
|
|
|
sclist = s;
|
|
|
|
else
|
|
|
|
tailsc->next = s;
|
|
|
|
s->next = NULL;
|
2014-07-27 19:13:46 +00:00
|
|
|
|
2017-12-29 19:27:33 +01:00
|
|
|
/* Fill in the data. */
|
|
|
|
s->menus = menus;
|
2018-02-24 19:31:11 +01:00
|
|
|
s->func = func;
|
2016-09-01 09:36:47 +02:00
|
|
|
#ifndef NANO_TINY
|
2017-12-29 19:27:33 +01:00
|
|
|
s->toggle = toggle;
|
2019-04-09 17:54:29 +02:00
|
|
|
/* When not the same toggle as the previous one, increment the ID. */
|
2017-12-29 19:27:33 +01:00
|
|
|
if (toggle)
|
2019-04-09 17:54:29 +02:00
|
|
|
s->ordinal = (tailsc->toggle == toggle) ? counter : ++counter;
|
2016-09-01 09:36:47 +02:00
|
|
|
#endif
|
2017-12-29 19:27:33 +01:00
|
|
|
assign_keyinfo(s, scstring, keycode);
|
2008-03-05 07:34:01 +00:00
|
|
|
|
2019-04-09 17:54:29 +02:00
|
|
|
tailsc = s;
|
2000-06-06 05:53:49 +00:00
|
|
|
}
|
|
|
|
|
2014-07-27 19:23:41 +00:00
|
|
|
/* Return the first shortcut in the list of shortcuts that
|
|
|
|
* matches the given func in the given menu. */
|
2019-04-03 17:34:05 +02:00
|
|
|
const keystruct *first_sc_for(int menu, void (*func)(void))
|
2014-07-27 19:23:41 +00:00
|
|
|
{
|
2019-04-03 17:34:05 +02:00
|
|
|
const keystruct *s;
|
2014-07-27 19:23:41 +00:00
|
|
|
|
2017-12-29 19:27:33 +01:00
|
|
|
for (s = sclist; s != NULL; s = s->next)
|
2018-02-24 19:31:11 +01:00
|
|
|
if ((s->menus & menu) && s->func == func)
|
2017-12-29 19:27:33 +01:00
|
|
|
return s;
|
2014-07-27 19:23:41 +00:00
|
|
|
|
2017-12-29 19:27:33 +01:00
|
|
|
return NULL;
|
2014-07-27 19:23:41 +00:00
|
|
|
}
|
|
|
|
|
2016-12-22 12:02:11 +01:00
|
|
|
/* Return the first keycode that is bound to the given function in the
|
|
|
|
* current menu, if any; otherwise, return the given default value. */
|
|
|
|
int the_code_for(void (*func)(void), int defaultval)
|
2008-03-09 02:52:40 +00:00
|
|
|
{
|
2019-04-03 17:34:05 +02:00
|
|
|
const keystruct *s = first_sc_for(currmenu, func);
|
2008-03-09 02:52:40 +00:00
|
|
|
|
2017-12-29 19:27:33 +01:00
|
|
|
if (s == NULL)
|
|
|
|
return defaultval;
|
2016-12-22 12:02:11 +01:00
|
|
|
|
2017-12-29 19:27:33 +01:00
|
|
|
meta_key = s->meta;
|
|
|
|
return s->keycode;
|
2008-03-09 02:52:40 +00:00
|
|
|
}
|
|
|
|
|
2019-09-27 19:07:25 +02:00
|
|
|
/* Return the number of entries that can be shown in the given menu. */
|
|
|
|
size_t shown_entries_for(int menu)
|
2019-09-27 18:41:22 +02:00
|
|
|
{
|
2019-09-28 11:58:25 +02:00
|
|
|
funcstruct *item = allfuncs;
|
2019-10-01 13:25:03 +02:00
|
|
|
size_t maximum = ((COLS + 40) / 20) * 2;
|
2019-09-27 18:53:44 +02:00
|
|
|
size_t count = 0;
|
2019-09-27 18:41:22 +02:00
|
|
|
|
2019-10-01 13:25:03 +02:00
|
|
|
while (count < maximum && item != NULL) {
|
2019-09-29 13:00:27 +02:00
|
|
|
if (item->menus & menu)
|
2019-09-27 18:53:44 +02:00
|
|
|
count++;
|
2019-09-28 11:58:25 +02:00
|
|
|
item = item->next;
|
|
|
|
}
|
2019-09-27 18:41:22 +02:00
|
|
|
|
2019-09-29 13:00:27 +02:00
|
|
|
/* When --tempfile is not used, widen the grid of the WriteOut menu. */
|
|
|
|
if (menu == MWRITEFILE && first_sc_for(menu, discard_buffer) == NULL)
|
|
|
|
count--;
|
|
|
|
|
2019-09-28 11:58:25 +02:00
|
|
|
return count;
|
2019-09-27 18:41:22 +02:00
|
|
|
}
|
|
|
|
|
2019-09-27 17:41:17 +02:00
|
|
|
/* Return the shortcut that corresponds to the values of kbinput (the
|
|
|
|
* key itself) and meta_key (whether the key is a meta sequence). The
|
|
|
|
* returned shortcut will be the first in the list that corresponds to
|
|
|
|
* the given sequence. */
|
|
|
|
const keystruct *get_shortcut(int *kbinput)
|
|
|
|
{
|
|
|
|
/* Plain characters cannot be shortcuts, so just skip those. */
|
|
|
|
if (!meta_key && ((*kbinput >= 0x20 && *kbinput < 0x7F) ||
|
|
|
|
(*kbinput >= 0xA0 && *kbinput <= 0xFF)))
|
|
|
|
return NULL;
|
|
|
|
|
2019-10-03 17:19:29 +02:00
|
|
|
for (keystruct *s = sclist; s != NULL; s = s->next) {
|
2019-09-27 17:41:17 +02:00
|
|
|
if ((s->menus & currmenu) && *kbinput == s->keycode &&
|
|
|
|
meta_key == s->meta)
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2014-07-02 08:47:09 +00:00
|
|
|
/* Return a pointer to the function that is bound to the given key. */
|
|
|
|
functionptrtype func_from_key(int *kbinput)
|
|
|
|
{
|
2019-04-03 17:34:05 +02:00
|
|
|
const keystruct *s = get_shortcut(kbinput);
|
2014-07-02 08:47:09 +00:00
|
|
|
|
2017-12-29 19:27:33 +01:00
|
|
|
if (s)
|
2018-02-24 19:31:11 +01:00
|
|
|
return s->func;
|
2017-12-29 19:27:33 +01:00
|
|
|
else
|
|
|
|
return NULL;
|
2014-07-02 08:47:09 +00:00
|
|
|
}
|
|
|
|
|
2017-08-11 15:23:56 +03:00
|
|
|
/* Parse the given keystring and return the corresponding keycode,
|
|
|
|
* or return -1 when the string is invalid. */
|
|
|
|
int keycode_from_string(const char *keystring)
|
|
|
|
{
|
2017-12-29 19:27:33 +01:00
|
|
|
if (keystring[0] == '^') {
|
2019-12-12 18:40:15 +01:00
|
|
|
if (keystring[2] == '\0') {
|
|
|
|
if (keystring[1] == '/')
|
|
|
|
return 31;
|
2018-09-14 21:57:24 +02:00
|
|
|
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
|
2019-12-12 18:40:15 +01:00
|
|
|
if (keystring[1] == 'H')
|
|
|
|
return KEY_BACKSPACE;
|
2018-09-14 21:57:24 +02:00
|
|
|
#endif
|
2019-12-12 18:40:15 +01:00
|
|
|
if (keystring[1] <= '_')
|
|
|
|
return keystring[1] - 64;
|
|
|
|
else
|
|
|
|
return -1;
|
|
|
|
} else if (strcasecmp(keystring, "^Space") == 0)
|
|
|
|
return 0;
|
2017-12-29 19:27:33 +01:00
|
|
|
else
|
|
|
|
return -1;
|
|
|
|
} else if (keystring[0] == 'M') {
|
2019-12-12 11:45:15 +01:00
|
|
|
if (keystring[1] == '-' && keystring[3] == '\0')
|
2017-12-29 19:27:33 +01:00
|
|
|
return tolower((unsigned char)keystring[2]);
|
2019-12-12 12:34:56 +01:00
|
|
|
if (strcasecmp(keystring, "M-Space") == 0)
|
|
|
|
return (int)' ';
|
2017-12-29 19:27:33 +01:00
|
|
|
else
|
|
|
|
return -1;
|
|
|
|
} else if (keystring[0] == 'F') {
|
|
|
|
int fn = atoi(&keystring[1]);
|
2019-10-07 16:10:26 +02:00
|
|
|
if (fn < 1 || fn > 24)
|
2017-12-29 19:27:33 +01:00
|
|
|
return -1;
|
|
|
|
return KEY_F0 + fn;
|
2019-12-12 12:34:56 +01:00
|
|
|
} else if (strcasecmp(keystring, "Ins") == 0)
|
2017-12-29 19:27:33 +01:00
|
|
|
return KEY_IC;
|
2019-12-12 12:34:56 +01:00
|
|
|
else if (strcasecmp(keystring, "Del") == 0)
|
2017-12-29 19:27:33 +01:00
|
|
|
return KEY_DC;
|
2016-10-11 10:50:04 +02:00
|
|
|
else
|
2017-12-29 19:27:33 +01:00
|
|
|
return -1;
|
2008-03-05 07:34:01 +00:00
|
|
|
}
|
|
|
|
|
2019-09-27 18:41:22 +02:00
|
|
|
/* Set the string and its corresponding keycode for the given shortcut s. */
|
|
|
|
void assign_keyinfo(keystruct *s, const char *keystring, const int keycode)
|
|
|
|
{
|
|
|
|
s->keystr = keystring;
|
|
|
|
s->meta = (keystring[0] == 'M' && keycode == 0);
|
2019-12-12 12:34:56 +01:00
|
|
|
s->keycode = (keycode ? keycode : keycode_from_string(keystring));
|
2019-09-27 18:41:22 +02:00
|
|
|
}
|
|
|
|
|
2018-11-26 09:13:22 +01:00
|
|
|
/* These two tags are used elsewhere too, so they are global. */
|
|
|
|
/* TRANSLATORS: Try to keep the next two strings at most 10 characters. */
|
2014-04-26 19:01:18 +00:00
|
|
|
const char *exit_tag = N_("Exit");
|
|
|
|
const char *close_tag = N_("Close");
|
2008-03-05 07:34:01 +00:00
|
|
|
|
2014-04-07 09:24:10 +00:00
|
|
|
/* Initialize the list of functions and the list of shortcuts. */
|
|
|
|
void shortcut_init(void)
|
2000-09-01 13:32:47 +00:00
|
|
|
{
|
2017-04-25 17:51:45 +02:00
|
|
|
#ifdef ENABLE_HELP
|
2017-12-29 19:27:33 +01:00
|
|
|
/* TRANSLATORS: The next long series of strings are shortcut descriptions;
|
|
|
|
* they are best kept shorter than 56 characters, but may be longer. */
|
|
|
|
const char *cancel_gist = N_("Cancel the current function");
|
|
|
|
const char *help_gist = N_("Display this help text");
|
2019-12-12 11:38:32 +01:00
|
|
|
const char *exit_gist = N_("Close the current buffer / Exit from nano");
|
2017-12-29 19:27:33 +01:00
|
|
|
const char *writeout_gist =
|
2018-02-19 20:35:47 +01:00
|
|
|
N_("Write the current buffer (or the marked region) to disk");
|
2017-12-29 19:27:33 +01:00
|
|
|
const char *readfile_gist =
|
2018-02-22 19:52:27 +01:00
|
|
|
N_("Insert another file into current buffer (or into new buffer)");
|
2017-12-29 19:27:33 +01:00
|
|
|
const char *whereis_gist =
|
|
|
|
N_("Search forward for a string or a regular expression");
|
|
|
|
const char *wherewas_gist =
|
|
|
|
N_("Search backward for a string or a regular expression");
|
|
|
|
const char *cut_gist =
|
2018-02-19 20:35:47 +01:00
|
|
|
N_("Cut current line (or marked region) and store it in cutbuffer");
|
2017-12-29 19:27:33 +01:00
|
|
|
const char *uncut_gist =
|
2019-03-03 14:36:12 +01:00
|
|
|
N_("Paste the contents of cutbuffer at current cursor position");
|
2017-12-29 19:27:33 +01:00
|
|
|
const char *cursorpos_gist = N_("Display the position of the cursor");
|
2017-10-31 19:32:42 +01:00
|
|
|
#ifdef ENABLE_SPELLER
|
2017-12-29 19:27:33 +01:00
|
|
|
const char *spell_gist = N_("Invoke the spell checker, if available");
|
2014-04-03 21:06:30 +00:00
|
|
|
#endif
|
2017-12-29 19:27:33 +01:00
|
|
|
const char *replace_gist = N_("Replace a string or a regular expression");
|
|
|
|
const char *gotoline_gist = N_("Go to line and column number");
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2017-12-29 19:27:33 +01:00
|
|
|
const char *mark_gist = N_("Mark text starting from the cursor position");
|
|
|
|
const char *copy_gist =
|
2018-02-19 20:35:47 +01:00
|
|
|
N_("Copy current line (or marked region) and store it in cutbuffer");
|
2018-10-23 20:25:22 -06:00
|
|
|
const char *zap_gist = N_("Throw away the current line (or marked region)");
|
2017-12-29 19:27:33 +01:00
|
|
|
const char *indent_gist = N_("Indent the current line (or marked lines)");
|
|
|
|
const char *unindent_gist = N_("Unindent the current line (or marked lines)");
|
|
|
|
const char *undo_gist = N_("Undo the last operation");
|
|
|
|
const char *redo_gist = N_("Redo the last undone operation");
|
|
|
|
#endif
|
|
|
|
const char *back_gist = N_("Go back one character");
|
|
|
|
const char *forward_gist = N_("Go forward one character");
|
|
|
|
const char *prevword_gist = N_("Go back one word");
|
|
|
|
const char *nextword_gist = N_("Go forward one word");
|
|
|
|
const char *prevline_gist = N_("Go to previous line");
|
|
|
|
const char *nextline_gist = N_("Go to next line");
|
|
|
|
const char *home_gist = N_("Go to beginning of current line");
|
|
|
|
const char *end_gist = N_("Go to end of current line");
|
|
|
|
const char *prevblock_gist = N_("Go to previous block of text");
|
|
|
|
const char *nextblock_gist = N_("Go to next block of text");
|
2017-10-31 17:34:07 +01:00
|
|
|
#ifdef ENABLE_JUSTIFY
|
2017-12-29 19:27:33 +01:00
|
|
|
const char *parabegin_gist =
|
|
|
|
N_("Go to beginning of paragraph; then of previous paragraph");
|
|
|
|
const char *paraend_gist =
|
|
|
|
N_("Go just beyond end of paragraph; then of next paragraph");
|
2006-04-24 21:14:55 +00:00
|
|
|
#endif
|
2019-12-12 11:38:32 +01:00
|
|
|
const char *prevpage_gist = N_("Go one screenful up");
|
|
|
|
const char *nextpage_gist = N_("Go one screenful down");
|
2017-12-29 19:27:33 +01:00
|
|
|
const char *firstline_gist = N_("Go to the first line of the file");
|
|
|
|
const char *lastline_gist = N_("Go to the last line of the file");
|
2006-04-24 21:14:55 +00:00
|
|
|
#ifndef NANO_TINY
|
2017-12-29 19:27:33 +01:00
|
|
|
const char *bracket_gist = N_("Go to the matching bracket");
|
2018-03-31 16:50:26 +02:00
|
|
|
#endif
|
2018-10-24 17:30:27 +02:00
|
|
|
#if !defined(NANO_TINY) || defined(ENABLE_HELP)
|
2017-12-29 19:27:33 +01:00
|
|
|
const char *scrollup_gist =
|
2018-03-22 11:14:32 +01:00
|
|
|
N_("Scroll up one line without moving the cursor textually");
|
2017-12-29 19:27:33 +01:00
|
|
|
const char *scrolldown_gist =
|
2018-03-22 11:14:32 +01:00
|
|
|
N_("Scroll down one line without moving the cursor textually");
|
2004-09-11 21:41:13 +00:00
|
|
|
#endif
|
2017-05-01 20:20:34 +02:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2017-12-29 19:27:33 +01:00
|
|
|
const char *prevfile_gist = N_("Switch to the previous file buffer");
|
|
|
|
const char *nextfile_gist = N_("Switch to the next file buffer");
|
|
|
|
#endif
|
|
|
|
const char *verbatim_gist = N_("Insert the next keystroke verbatim");
|
|
|
|
const char *tab_gist = N_("Insert a tab at the cursor position");
|
|
|
|
const char *enter_gist = N_("Insert a newline at the cursor position");
|
|
|
|
const char *delete_gist = N_("Delete the character under the cursor");
|
|
|
|
const char *backspace_gist =
|
|
|
|
N_("Delete the character to the left of the cursor");
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2019-02-24 17:27:22 +01:00
|
|
|
const char *chopwordleft_gist =
|
2019-02-24 11:00:06 +01:00
|
|
|
N_("Delete backward from cursor to word start");
|
2019-02-24 17:27:22 +01:00
|
|
|
const char *chopwordright_gist =
|
2019-02-24 11:00:06 +01:00
|
|
|
N_("Delete forward from cursor to next word start");
|
2017-12-29 19:27:33 +01:00
|
|
|
const char *cuttilleof_gist =
|
|
|
|
N_("Cut from the cursor position to the end of the file");
|
2005-01-01 07:43:32 +00:00
|
|
|
#endif
|
2017-10-31 17:34:07 +01:00
|
|
|
#ifdef ENABLE_JUSTIFY
|
2017-12-29 19:27:33 +01:00
|
|
|
const char *justify_gist = N_("Justify the current paragraph");
|
|
|
|
const char *fulljustify_gist = N_("Justify the entire file");
|
2004-07-12 03:10:30 +00:00
|
|
|
#endif
|
2005-11-15 23:45:29 +00:00
|
|
|
#ifndef NANO_TINY
|
2017-12-29 19:27:33 +01:00
|
|
|
const char *wordcount_gist =
|
|
|
|
N_("Count the number of words, lines, and characters");
|
2004-08-07 21:27:37 +00:00
|
|
|
#endif
|
2017-12-29 19:27:33 +01:00
|
|
|
const char *refresh_gist =
|
|
|
|
N_("Refresh (redraw) the current screen");
|
|
|
|
const char *suspend_gist =
|
|
|
|
N_("Suspend the editor (if suspension is enabled)");
|
2016-12-07 13:10:40 +01:00
|
|
|
#ifdef ENABLE_WORDCOMPLETION
|
2017-12-29 19:27:33 +01:00
|
|
|
const char *completion_gist = N_("Try and complete the current word");
|
2016-12-07 13:10:40 +01:00
|
|
|
#endif
|
2016-12-07 19:56:27 +01:00
|
|
|
#ifdef ENABLE_COMMENT
|
2017-12-29 19:27:33 +01:00
|
|
|
const char *comment_gist =
|
|
|
|
N_("Comment/uncomment the current line (or marked lines)");
|
2016-12-07 19:56:27 +01:00
|
|
|
#endif
|
2017-12-29 19:27:33 +01:00
|
|
|
const char *savefile_gist = N_("Save file without prompting");
|
|
|
|
const char *findprev_gist = N_("Search next occurrence backward");
|
|
|
|
const char *findnext_gist = N_("Search next occurrence forward");
|
2018-07-25 21:27:06 +02:00
|
|
|
#ifndef NANO_TINY
|
2017-12-29 19:27:33 +01:00
|
|
|
const char *recordmacro_gist = N_("Start/stop recording a macro");
|
|
|
|
const char *runmacro_gist = N_("Run the last recorded macro");
|
|
|
|
#endif
|
2019-12-12 11:38:32 +01:00
|
|
|
const char *case_gist = N_("Toggle the case sensitivity of the search");
|
|
|
|
const char *reverse_gist = N_("Reverse the direction of the search");
|
|
|
|
const char *regexp_gist = N_("Toggle the use of regular expressions");
|
2017-10-29 19:42:12 +01:00
|
|
|
#ifdef ENABLE_HISTORIES
|
2018-10-08 19:27:56 +02:00
|
|
|
const char *older_gist =
|
2017-12-29 19:27:33 +01:00
|
|
|
N_("Recall the previous search/replace string");
|
2018-10-08 19:27:56 +02:00
|
|
|
const char *newer_gist =
|
2017-12-29 19:27:33 +01:00
|
|
|
N_("Recall the next search/replace string");
|
2005-06-03 20:51:39 +00:00
|
|
|
#endif
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2017-12-29 19:27:33 +01:00
|
|
|
const char *dos_gist = N_("Toggle the use of DOS format");
|
|
|
|
const char *mac_gist = N_("Toggle the use of Mac format");
|
|
|
|
const char *append_gist = N_("Toggle appending");
|
|
|
|
const char *prepend_gist = N_("Toggle prepending");
|
|
|
|
const char *backup_gist = N_("Toggle backing up of the original file");
|
|
|
|
const char *execute_gist = N_("Execute external command");
|
2018-05-29 09:05:58 +02:00
|
|
|
const char *pipe_gist =
|
|
|
|
N_("Pipe the current buffer (or marked region) to the command");
|
2018-08-19 12:35:15 +02:00
|
|
|
const char *convert_gist = N_("Do not convert from DOS/Mac format");
|
2017-05-08 21:59:36 +02:00
|
|
|
#endif
|
2017-05-01 20:20:34 +02:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2017-12-29 19:27:33 +01:00
|
|
|
const char *newbuffer_gist = N_("Toggle the use of a new buffer");
|
2017-04-25 20:42:05 +02:00
|
|
|
#endif
|
2017-12-29 19:27:33 +01:00
|
|
|
const char *discardbuffer_gist = N_("Close buffer without saving it");
|
2017-05-08 19:08:23 +02:00
|
|
|
#ifdef ENABLE_BROWSER
|
2017-12-29 19:27:33 +01:00
|
|
|
const char *tofiles_gist = N_("Go to file browser");
|
|
|
|
const char *exitbrowser_gist = N_("Exit from the file browser");
|
|
|
|
const char *firstfile_gist = N_("Go to the first file in the list");
|
|
|
|
const char *lastfile_gist = N_("Go to the last file in the list");
|
|
|
|
const char *backfile_gist = N_("Go to the previous file in the list");
|
|
|
|
const char *forwardfile_gist = N_("Go to the next file in the list");
|
2019-12-12 11:38:32 +01:00
|
|
|
#ifndef NANO_TINY
|
|
|
|
const char *browserlefthand_gist = N_("Go to lefthand column");
|
|
|
|
const char *browserrighthand_gist = N_("Go to righthand column");
|
|
|
|
const char *browsertoprow_gist = N_("Go to first row in this column");
|
|
|
|
const char *browserbottomrow_gist = N_("Go to last row in this column");
|
|
|
|
#endif
|
|
|
|
const char *browserwhereis_gist = N_("Search forward for a string");
|
|
|
|
const char *browserwherewas_gist = N_("Search backward for a string");
|
|
|
|
const char *browserrefresh_gist = N_("Refresh the file list");
|
2017-12-29 19:27:33 +01:00
|
|
|
const char *gotodir_gist = N_("Go to directory");
|
2000-06-06 05:53:49 +00:00
|
|
|
#endif
|
2017-11-01 19:45:33 +01:00
|
|
|
#ifdef ENABLE_COLOR
|
2017-12-29 19:27:33 +01:00
|
|
|
const char *lint_gist = N_("Invoke the linter, if available");
|
|
|
|
const char *prevlint_gist = N_("Go to previous linter msg");
|
|
|
|
const char *nextlint_gist = N_("Go to next linter msg");
|
2019-10-09 19:42:22 +02:00
|
|
|
#ifdef ENABLE_SPELLER
|
2019-10-25 17:17:48 +02:00
|
|
|
const char *formatter_gist =
|
|
|
|
N_("Invoke a program to format/arrange/manipulate the buffer");
|
2019-10-09 19:42:22 +02:00
|
|
|
#endif
|
2015-03-27 16:55:49 +00:00
|
|
|
#endif
|
2017-04-25 17:51:45 +02:00
|
|
|
#endif /* ENABLE_HELP */
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2017-04-25 17:51:45 +02:00
|
|
|
#ifdef ENABLE_HELP
|
2017-10-28 11:51:24 +02:00
|
|
|
#define WITHORSANS(help) help
|
2004-03-02 22:52:57 +00:00
|
|
|
#else
|
2017-10-28 11:51:24 +02:00
|
|
|
#define WITHORSANS(help) ""
|
2002-04-23 10:56:06 +00:00
|
|
|
#endif
|
2003-11-28 19:47:42 +00:00
|
|
|
|
2017-12-29 19:27:33 +01:00
|
|
|
/* Start populating the different menus with functions. */
|
2014-04-13 12:16:37 +00:00
|
|
|
|
2019-12-15 19:47:05 +01:00
|
|
|
add_to_funcs(do_help, (MMOST | MBROWSER) & ~MFINDINHELP,
|
2019-09-24 17:07:15 +02:00
|
|
|
/* TRANSLATORS: Try to keep the next eleven strings at most 10 characters. */
|
2017-12-29 19:27:33 +01:00
|
|
|
N_("Get Help"), WITHORSANS(help_gist), TOGETHER, VIEW);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2019-02-06 16:27:27 +01:00
|
|
|
add_to_funcs(do_cancel, ((MMOST & ~MMAIN) | MYESNO),
|
2017-12-29 19:27:33 +01:00
|
|
|
N_("Cancel"), WITHORSANS(cancel_gist), BLANKAFTER, VIEW);
|
2008-03-05 07:34:01 +00:00
|
|
|
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(do_exit, MMAIN,
|
|
|
|
exit_tag, WITHORSANS(exit_gist), TOGETHER, VIEW);
|
|
|
|
/* Remember the entry for Exit, to be able to replace it with Close. */
|
|
|
|
exitfunc = tailfunc;
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2017-05-08 19:08:23 +02:00
|
|
|
#ifdef ENABLE_BROWSER
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(do_exit, MBROWSER,
|
2018-12-03 09:54:30 +01:00
|
|
|
close_tag, WITHORSANS(exitbrowser_gist), TOGETHER, VIEW);
|
2008-03-20 04:51:26 +00:00
|
|
|
#endif
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(do_writeout_void, MMAIN,
|
|
|
|
N_("Write Out"), WITHORSANS(writeout_gist), TOGETHER, NOVIEW);
|
2008-03-05 07:34:01 +00:00
|
|
|
|
2017-10-31 17:34:07 +01:00
|
|
|
#ifdef ENABLE_JUSTIFY
|
2019-05-08 13:48:52 +02:00
|
|
|
/* In restricted mode, replace Insert with Justify, when possible;
|
|
|
|
* otherwise, show Insert anyway, to keep the help items paired. */
|
|
|
|
if (!ISSET(RESTRICTED))
|
2017-12-29 19:27:33 +01:00
|
|
|
#endif
|
|
|
|
add_to_funcs(do_insertfile_void, MMAIN,
|
2018-07-30 20:45:15 +02:00
|
|
|
N_("Read File"), WITHORSANS(readfile_gist), BLANKAFTER,
|
2017-12-29 19:27:33 +01:00
|
|
|
/* We allow inserting files in view mode if multibuffer mode
|
2019-05-08 13:48:52 +02:00
|
|
|
* is available, so that the user can view multiple files. */
|
2018-10-12 19:55:18 +02:00
|
|
|
CAN_OPEN_OTHER_BUFFER);
|
2017-10-31 17:34:07 +01:00
|
|
|
#ifdef ENABLE_JUSTIFY
|
2019-05-08 13:48:52 +02:00
|
|
|
else
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(do_justify_void, MMAIN,
|
2018-07-30 20:45:15 +02:00
|
|
|
N_("Justify"), WITHORSANS(justify_gist), BLANKAFTER, NOVIEW);
|
2015-07-30 10:37:28 +00:00
|
|
|
#endif
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2018-07-30 21:03:08 +02:00
|
|
|
#ifdef ENABLE_HELP
|
|
|
|
/* The description ("x") and blank_after (0) are irrelevant,
|
|
|
|
* because the help viewer does not have a help text. */
|
|
|
|
add_to_funcs(total_refresh, MHELP, N_("Refresh"), "x", 0, VIEW);
|
|
|
|
add_to_funcs(do_exit, MHELP, close_tag, "x", 0, VIEW);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
add_to_funcs(do_search_forward, MMAIN|MHELP,
|
2018-07-30 20:45:15 +02:00
|
|
|
N_("Where Is"), WITHORSANS(whereis_gist), TOGETHER, VIEW);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(do_replace, MMAIN,
|
2018-07-30 20:45:15 +02:00
|
|
|
N_("Replace"), WITHORSANS(replace_gist), TOGETHER, NOVIEW);
|
2014-04-27 19:51:03 +00:00
|
|
|
|
2019-05-03 19:51:15 +02:00
|
|
|
add_to_funcs(cut_text, MMAIN,
|
2017-12-29 19:27:33 +01:00
|
|
|
N_("Cut Text"), WITHORSANS(cut_gist), TOGETHER, NOVIEW);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2019-05-03 19:47:08 +02:00
|
|
|
add_to_funcs(paste_text, MMAIN,
|
2019-03-03 14:36:12 +01:00
|
|
|
N_("Paste Text"), WITHORSANS(uncut_gist), BLANKAFTER, NOVIEW);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2017-12-29 19:27:33 +01:00
|
|
|
if (!ISSET(RESTRICTED)) {
|
2017-10-31 17:34:07 +01:00
|
|
|
#ifdef ENABLE_JUSTIFY
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(do_justify_void, MMAIN,
|
2018-07-30 20:45:15 +02:00
|
|
|
N_("Justify"), WITHORSANS(justify_gist), TOGETHER, NOVIEW);
|
2008-03-09 02:52:40 +00:00
|
|
|
#endif
|
2017-10-31 19:32:42 +01:00
|
|
|
#ifdef ENABLE_SPELLER
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(do_spell, MMAIN,
|
2018-09-30 13:57:33 +02:00
|
|
|
N_("To Spell"), WITHORSANS(spell_gist), BLANKAFTER, NOVIEW);
|
2015-03-27 16:55:49 +00:00
|
|
|
#endif
|
2017-12-29 19:27:33 +01:00
|
|
|
}
|
2014-02-24 10:18:15 +00:00
|
|
|
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(do_cursorpos_void, MMAIN,
|
2019-09-24 17:07:15 +02:00
|
|
|
/* TRANSLATORS: Try to keep the next thirteen strings at most 12 characters. */
|
2017-12-29 19:27:33 +01:00
|
|
|
N_("Cur Pos"), WITHORSANS(cursorpos_gist), TOGETHER, VIEW);
|
2016-09-03 13:41:02 +02:00
|
|
|
|
2017-11-01 19:45:33 +01:00
|
|
|
#if (defined(ENABLE_JUSTIFY) && (defined(ENABLE_SPELLER) || defined(ENABLE_COLOR)) || \
|
2017-12-29 19:27:33 +01:00
|
|
|
!defined(ENABLE_JUSTIFY) && !defined(ENABLE_SPELLER) && !defined(ENABLE_COLOR))
|
|
|
|
/* Conditionally placing this one here or further on, to keep the
|
|
|
|
* help items nicely paired in most conditions. */
|
|
|
|
add_to_funcs(do_gotolinecolumn_void, MMAIN,
|
2018-07-30 20:45:15 +02:00
|
|
|
N_("Go To Line"), WITHORSANS(gotoline_gist), BLANKAFTER, VIEW);
|
2016-09-03 13:41:02 +02:00
|
|
|
#endif
|
|
|
|
|
2017-03-23 11:31:56 +01:00
|
|
|
#ifndef NANO_TINY
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(do_undo, MMAIN,
|
|
|
|
N_("Undo"), WITHORSANS(undo_gist), TOGETHER, NOVIEW);
|
|
|
|
add_to_funcs(do_redo, MMAIN,
|
|
|
|
N_("Redo"), WITHORSANS(redo_gist), BLANKAFTER, NOVIEW);
|
2017-03-23 11:31:56 +01:00
|
|
|
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(do_mark, MMAIN,
|
|
|
|
N_("Mark Text"), WITHORSANS(mark_gist), TOGETHER, VIEW);
|
2019-05-03 19:47:08 +02:00
|
|
|
add_to_funcs(copy_text, MMAIN,
|
2017-12-29 19:27:33 +01:00
|
|
|
N_("Copy Text"), WITHORSANS(copy_gist), BLANKAFTER, NOVIEW);
|
2017-03-23 11:31:56 +01:00
|
|
|
#endif
|
|
|
|
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(case_sens_void, MWHEREIS|MREPLACE,
|
|
|
|
N_("Case Sens"), WITHORSANS(case_gist), TOGETHER, VIEW);
|
|
|
|
add_to_funcs(regexp_void, MWHEREIS|MREPLACE,
|
|
|
|
N_("Regexp"), WITHORSANS(regexp_gist), TOGETHER, VIEW);
|
|
|
|
add_to_funcs(backwards_void, MWHEREIS|MREPLACE,
|
|
|
|
N_("Backwards"), WITHORSANS(reverse_gist), TOGETHER, VIEW);
|
2014-04-27 14:21:57 +00:00
|
|
|
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(flip_replace, MWHEREIS,
|
2018-07-30 20:45:15 +02:00
|
|
|
N_("Replace"), WITHORSANS(replace_gist), BLANKAFTER, VIEW);
|
2014-04-27 14:21:57 +00:00
|
|
|
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(flip_replace, MREPLACE,
|
|
|
|
N_("No Replace"), WITHORSANS(whereis_gist), BLANKAFTER, VIEW);
|
2014-04-27 14:21:57 +00:00
|
|
|
|
2018-10-08 19:48:02 +02:00
|
|
|
#ifdef ENABLE_HISTORIES
|
|
|
|
add_to_funcs(get_history_older_void, MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE,
|
|
|
|
N_("Older"), WITHORSANS(older_gist), TOGETHER, VIEW);
|
|
|
|
add_to_funcs(get_history_newer_void, MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE,
|
|
|
|
N_("Newer"), WITHORSANS(newer_gist), BLANKAFTER, VIEW);
|
|
|
|
#endif
|
2014-04-27 19:51:03 +00:00
|
|
|
|
2018-02-04 10:34:39 +01:00
|
|
|
add_to_funcs(flip_goto, MWHEREIS,
|
2019-02-17 10:10:10 +01:00
|
|
|
N_("Go To Line"), WITHORSANS(gotoline_gist), TOGETHER, VIEW);
|
|
|
|
|
|
|
|
#ifdef ENABLE_JUSTIFY
|
|
|
|
add_to_funcs(do_full_justify, MWHEREIS,
|
|
|
|
N_("FullJstify"), WITHORSANS(fulljustify_gist), BLANKAFTER, NOVIEW);
|
2014-05-27 12:17:49 +00:00
|
|
|
#endif
|
2014-04-27 19:51:03 +00:00
|
|
|
|
2018-07-24 17:11:25 -05:00
|
|
|
#ifdef ENABLE_BROWSER
|
2019-09-23 13:03:52 +02:00
|
|
|
add_to_funcs(goto_dir_void, MBROWSER,
|
2019-09-24 17:07:15 +02:00
|
|
|
/* TRANSLATORS: Try to keep the next seven strings at most 10 characters. */
|
2019-09-23 13:03:52 +02:00
|
|
|
N_("Go To Dir"), WITHORSANS(gotodir_gist), TOGETHER, VIEW);
|
|
|
|
|
|
|
|
add_to_funcs(total_refresh, MBROWSER,
|
|
|
|
N_("Refresh"), WITHORSANS(browserrefresh_gist), BLANKAFTER, VIEW);
|
|
|
|
|
2018-07-24 17:11:25 -05:00
|
|
|
add_to_funcs(do_search_forward, MBROWSER,
|
2018-07-30 20:45:15 +02:00
|
|
|
N_("Where Is"), WITHORSANS(browserwhereis_gist), TOGETHER, VIEW);
|
2018-07-24 17:11:25 -05:00
|
|
|
add_to_funcs(do_search_backward, MBROWSER,
|
2018-07-30 20:45:15 +02:00
|
|
|
N_("Where Was"), WITHORSANS(browserwherewas_gist), TOGETHER, VIEW);
|
2018-07-24 17:11:25 -05:00
|
|
|
#endif
|
2019-02-17 21:02:29 +01:00
|
|
|
|
|
|
|
#ifndef NANO_TINY
|
2019-09-23 13:03:52 +02:00
|
|
|
add_to_funcs(do_find_bracket, MMAIN,
|
|
|
|
N_("To Bracket"), WITHORSANS(bracket_gist), BLANKAFTER, VIEW);
|
|
|
|
|
2018-07-24 17:11:25 -05:00
|
|
|
add_to_funcs(do_search_backward, MMAIN|MHELP,
|
2018-07-25 21:27:06 +02:00
|
|
|
/* TRANSLATORS: This starts a backward search. */
|
|
|
|
N_("Where Was"), WITHORSANS(wherewas_gist), TOGETHER, VIEW);
|
2019-02-17 21:02:29 +01:00
|
|
|
#endif
|
2018-07-27 20:07:15 +02:00
|
|
|
add_to_funcs(do_findprevious, MMAIN|MHELP|MBROWSER,
|
2018-11-05 09:51:28 +01:00
|
|
|
/* TRANSLATORS: This refers to searching the preceding occurrence. */
|
2017-12-29 19:27:33 +01:00
|
|
|
N_("Previous"), WITHORSANS(findprev_gist), TOGETHER, VIEW);
|
2019-02-17 21:02:29 +01:00
|
|
|
#ifndef NANO_TINY
|
2018-07-27 20:07:15 +02:00
|
|
|
add_to_funcs(do_findnext, MMAIN|MHELP|MBROWSER,
|
2017-12-29 19:27:33 +01:00
|
|
|
N_("Next"), WITHORSANS(findnext_gist), BLANKAFTER, VIEW);
|
2019-02-17 21:02:29 +01:00
|
|
|
#else
|
|
|
|
/* In the tiny version, arrange things a bit differently, so that
|
|
|
|
* the useful M-W and M-Q are shown in the help lines. */
|
|
|
|
add_to_funcs(do_findnext, MMAIN|MHELP|MBROWSER,
|
|
|
|
N_("Next"), WITHORSANS(findnext_gist), TOGETHER, VIEW);
|
|
|
|
add_to_funcs(do_search_backward, MMAIN|MHELP,
|
|
|
|
N_("Where Was"), WITHORSANS(wherewas_gist), BLANKAFTER, VIEW);
|
|
|
|
add_to_funcs(total_refresh, MMAIN,
|
|
|
|
N_("Refresh"), WITHORSANS(refresh_gist), BLANKAFTER, VIEW);
|
|
|
|
#endif
|
2003-08-23 21:11:06 +00:00
|
|
|
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(do_left, MMAIN,
|
2018-08-29 20:05:37 +02:00
|
|
|
/* TRANSLATORS: This means move the cursor one character back. */
|
2017-12-29 19:27:33 +01:00
|
|
|
N_("Back"), WITHORSANS(back_gist), TOGETHER, VIEW);
|
|
|
|
add_to_funcs(do_right, MMAIN,
|
|
|
|
N_("Forward"), WITHORSANS(forward_gist), TOGETHER, VIEW);
|
2017-05-08 19:08:23 +02:00
|
|
|
#ifdef ENABLE_BROWSER
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(do_left, MBROWSER,
|
|
|
|
N_("Back"), WITHORSANS(backfile_gist), TOGETHER, VIEW);
|
|
|
|
add_to_funcs(do_right, MBROWSER,
|
|
|
|
N_("Forward"), WITHORSANS(forwardfile_gist), TOGETHER, VIEW);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
add_to_funcs(do_prev_word_void, MMAIN,
|
2019-09-24 17:07:15 +02:00
|
|
|
/* TRANSLATORS: Try to keep the next eighteen strings at most 12 characters. */
|
2017-12-29 19:27:33 +01:00
|
|
|
N_("Prev Word"), WITHORSANS(prevword_gist), TOGETHER, VIEW);
|
|
|
|
add_to_funcs(do_next_word_void, MMAIN,
|
|
|
|
N_("Next Word"), WITHORSANS(nextword_gist), TOGETHER, VIEW);
|
|
|
|
|
|
|
|
add_to_funcs(do_home, MMAIN,
|
|
|
|
N_("Home"), WITHORSANS(home_gist), TOGETHER, VIEW);
|
|
|
|
add_to_funcs(do_end, MMAIN,
|
|
|
|
N_("End"), WITHORSANS(end_gist), BLANKAFTER, VIEW);
|
|
|
|
|
2018-03-12 18:28:44 +01:00
|
|
|
add_to_funcs(do_up, MMAIN|MHELP|MBROWSER,
|
2018-07-30 20:45:15 +02:00
|
|
|
N_("Prev Line"), WITHORSANS(prevline_gist), TOGETHER, VIEW);
|
2018-03-12 18:28:44 +01:00
|
|
|
add_to_funcs(do_down, MMAIN|MHELP|MBROWSER,
|
2018-07-30 20:45:15 +02:00
|
|
|
N_("Next Line"), WITHORSANS(nextline_gist), TOGETHER, VIEW);
|
2018-10-24 17:30:27 +02:00
|
|
|
#if !defined(NANO_TINY) || defined(ENABLE_HELP)
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(do_scroll_up, MMAIN,
|
|
|
|
N_("Scroll Up"), WITHORSANS(scrollup_gist), TOGETHER, VIEW);
|
|
|
|
add_to_funcs(do_scroll_down, MMAIN,
|
|
|
|
N_("Scroll Down"), WITHORSANS(scrolldown_gist), BLANKAFTER, VIEW);
|
2017-03-23 11:31:56 +01:00
|
|
|
#endif
|
2001-10-22 03:15:31 +00:00
|
|
|
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(do_prev_block, MMAIN,
|
|
|
|
N_("Prev Block"), WITHORSANS(prevblock_gist), TOGETHER, VIEW);
|
|
|
|
add_to_funcs(do_next_block, MMAIN,
|
|
|
|
N_("Next Block"), WITHORSANS(nextblock_gist), TOGETHER, VIEW);
|
2017-10-31 17:34:07 +01:00
|
|
|
#ifdef ENABLE_JUSTIFY
|
2019-02-12 19:18:11 +01:00
|
|
|
add_to_funcs(do_para_begin_void, MMAIN|MGOTOLINE,
|
2017-12-29 19:27:33 +01:00
|
|
|
N_("Beg of Par"), WITHORSANS(parabegin_gist), TOGETHER, VIEW);
|
2019-02-12 19:18:11 +01:00
|
|
|
add_to_funcs(do_para_end_void, MMAIN|MGOTOLINE,
|
2017-12-29 19:27:33 +01:00
|
|
|
N_("End of Par"), WITHORSANS(paraend_gist), BLANKAFTER, VIEW);
|
2006-04-24 20:50:52 +00:00
|
|
|
#endif
|
2005-01-01 07:43:32 +00:00
|
|
|
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(do_page_up, MMAIN|MHELP,
|
2018-07-30 20:45:15 +02:00
|
|
|
N_("Prev Page"), WITHORSANS(prevpage_gist), TOGETHER, VIEW);
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(do_page_down, MMAIN|MHELP,
|
2018-08-28 21:39:01 +02:00
|
|
|
N_("Next Page"), WITHORSANS(nextpage_gist), TOGETHER, VIEW);
|
2017-03-23 11:31:56 +01:00
|
|
|
|
2019-02-12 19:01:35 +01:00
|
|
|
add_to_funcs(to_first_line, MMAIN|MHELP|MGOTOLINE,
|
2017-12-29 19:27:33 +01:00
|
|
|
N_("First Line"), WITHORSANS(firstline_gist), TOGETHER, VIEW);
|
2019-02-12 19:01:35 +01:00
|
|
|
add_to_funcs(to_last_line, MMAIN|MHELP|MGOTOLINE,
|
2017-12-29 19:27:33 +01:00
|
|
|
N_("Last Line"), WITHORSANS(lastline_gist), BLANKAFTER, VIEW);
|
2003-11-28 19:47:42 +00:00
|
|
|
|
2017-05-01 20:20:34 +02:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(switch_to_prev_buffer, MMAIN,
|
|
|
|
N_("Prev File"), WITHORSANS(prevfile_gist), TOGETHER, VIEW);
|
|
|
|
add_to_funcs(switch_to_next_buffer, MMAIN,
|
|
|
|
N_("Next File"), WITHORSANS(nextfile_gist), BLANKAFTER, VIEW);
|
2008-03-05 07:34:01 +00:00
|
|
|
#endif
|
|
|
|
|
2017-11-01 19:45:33 +01:00
|
|
|
#if (!defined(ENABLE_JUSTIFY) && (defined(ENABLE_SPELLER) || defined(ENABLE_COLOR)) || \
|
2017-12-29 19:27:33 +01:00
|
|
|
defined(ENABLE_JUSTIFY) && !defined(ENABLE_SPELLER) && !defined(ENABLE_COLOR))
|
|
|
|
add_to_funcs(do_gotolinecolumn_void, MMAIN,
|
2018-07-30 20:45:15 +02:00
|
|
|
N_("Go To Line"), WITHORSANS(gotoline_gist), BLANKAFTER, VIEW);
|
2014-05-27 12:17:49 +00:00
|
|
|
#endif
|
|
|
|
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(do_tab, MMAIN,
|
2019-06-19 19:14:47 +02:00
|
|
|
/* TRANSLATORS: The next four strings are names of keyboard keys. */
|
2017-12-29 19:27:33 +01:00
|
|
|
N_("Tab"), WITHORSANS(tab_gist), TOGETHER, NOVIEW);
|
|
|
|
add_to_funcs(do_enter, MMAIN,
|
|
|
|
N_("Enter"), WITHORSANS(enter_gist), BLANKAFTER, NOVIEW);
|
2015-07-31 11:52:26 +00:00
|
|
|
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(do_backspace, MMAIN,
|
2018-11-07 20:48:04 +01:00
|
|
|
N_("Backspace"), WITHORSANS(backspace_gist), TOGETHER, NOVIEW);
|
|
|
|
add_to_funcs(do_delete, MMAIN,
|
|
|
|
N_("Delete"), WITHORSANS(delete_gist),
|
2006-04-22 20:00:23 +00:00
|
|
|
#ifndef NANO_TINY
|
2017-12-29 19:27:33 +01:00
|
|
|
TOGETHER,
|
2006-04-22 20:00:23 +00:00
|
|
|
#else
|
2017-12-29 19:27:33 +01:00
|
|
|
BLANKAFTER,
|
2006-04-22 20:00:23 +00:00
|
|
|
#endif
|
2017-12-29 19:27:33 +01:00
|
|
|
NOVIEW);
|
2008-03-12 04:44:14 +00:00
|
|
|
|
2008-03-05 07:34:01 +00:00
|
|
|
#ifndef NANO_TINY
|
2019-02-24 17:27:22 +01:00
|
|
|
add_to_funcs(chop_previous_word, MMAIN,
|
2019-02-24 16:29:49 +01:00
|
|
|
/* TRANSLATORS: The next two strings refer to deleting words. */
|
2019-02-24 17:27:22 +01:00
|
|
|
N_("Chop Left"), WITHORSANS(chopwordleft_gist), TOGETHER, NOVIEW);
|
|
|
|
add_to_funcs(chop_next_word, MMAIN,
|
|
|
|
N_("Chop Right"), WITHORSANS(chopwordright_gist), TOGETHER, NOVIEW);
|
2019-05-03 19:51:15 +02:00
|
|
|
add_to_funcs(cut_till_eof, MMAIN,
|
2017-12-29 19:27:33 +01:00
|
|
|
N_("CutTillEnd"), WITHORSANS(cuttilleof_gist), BLANKAFTER, NOVIEW);
|
2004-04-30 04:49:02 +00:00
|
|
|
#endif
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2017-10-31 17:34:07 +01:00
|
|
|
#ifdef ENABLE_JUSTIFY
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(do_full_justify, MMAIN,
|
2018-07-30 20:45:15 +02:00
|
|
|
N_("FullJstify"), WITHORSANS(fulljustify_gist), TOGETHER, NOVIEW);
|
2003-09-04 20:25:29 +00:00
|
|
|
#endif
|
|
|
|
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(do_wordlinechar_count, MMAIN,
|
|
|
|
N_("Word Count"), WITHORSANS(wordcount_gist), TOGETHER, VIEW);
|
2001-06-14 02:54:22 +00:00
|
|
|
#endif
|
2003-01-05 20:41:21 +00:00
|
|
|
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(do_verbatim_input, MMAIN,
|
|
|
|
N_("Verbatim"), WITHORSANS(verbatim_gist), BLANKAFTER, NOVIEW);
|
2017-04-11 13:15:00 +02:00
|
|
|
|
2019-02-17 21:02:29 +01:00
|
|
|
#ifndef NANO_TINY
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(total_refresh, MMAIN,
|
2018-07-30 20:45:15 +02:00
|
|
|
N_("Refresh"), WITHORSANS(refresh_gist), TOGETHER, VIEW);
|
2019-02-17 21:02:29 +01:00
|
|
|
#endif
|
2008-03-13 08:23:52 +00:00
|
|
|
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(do_suspend_void, MMAIN,
|
|
|
|
N_("Suspend"), WITHORSANS(suspend_gist), BLANKAFTER, VIEW);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2017-03-23 11:31:56 +01:00
|
|
|
#ifndef NANO_TINY
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(do_indent, MMAIN,
|
2018-08-29 20:17:41 +02:00
|
|
|
N_("Indent"), WITHORSANS(indent_gist), TOGETHER, NOVIEW);
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(do_unindent, MMAIN,
|
2018-08-29 20:17:41 +02:00
|
|
|
N_("Unindent"), WITHORSANS(unindent_gist), BLANKAFTER, NOVIEW);
|
2017-03-23 11:31:56 +01:00
|
|
|
#endif
|
2016-05-25 22:13:50 +02:00
|
|
|
#ifdef ENABLE_COMMENT
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(do_comment, MMAIN,
|
|
|
|
N_("Comment Lines"), WITHORSANS(comment_gist), TOGETHER, NOVIEW);
|
2017-12-26 21:36:29 +01:00
|
|
|
#endif
|
|
|
|
#ifdef ENABLE_WORDCOMPLETION
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(complete_a_word, MMAIN,
|
|
|
|
N_("Complete"), WITHORSANS(completion_gist), BLANKAFTER, NOVIEW);
|
2016-05-25 22:13:50 +02:00
|
|
|
#endif
|
2015-07-25 19:25:50 +00:00
|
|
|
#ifndef NANO_TINY
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(record_macro, MMAIN,
|
|
|
|
N_("Record"), WITHORSANS(recordmacro_gist), TOGETHER, VIEW);
|
|
|
|
add_to_funcs(run_macro, MMAIN,
|
|
|
|
N_("Run Macro"), WITHORSANS(runmacro_gist), BLANKAFTER, VIEW);
|
2018-07-25 21:27:06 +02:00
|
|
|
|
2018-10-23 20:25:22 -06:00
|
|
|
add_to_funcs(zap_text, MMAIN,
|
|
|
|
N_("Zap Text"), WITHORSANS(zap_gist), BLANKAFTER, NOVIEW);
|
|
|
|
|
2018-09-30 13:57:33 +02:00
|
|
|
#ifdef ENABLE_COLOR
|
2019-10-09 19:42:22 +02:00
|
|
|
if (!ISSET(RESTRICTED)) {
|
2018-09-30 13:57:33 +02:00
|
|
|
add_to_funcs(do_linter, MMAIN,
|
2019-10-09 19:42:22 +02:00
|
|
|
N_("To Linter"), WITHORSANS(lint_gist), TOGETHER, NOVIEW);
|
|
|
|
#ifdef ENABLE_SPELLER
|
2019-10-25 17:17:48 +02:00
|
|
|
add_to_funcs(do_formatter, MMAIN,
|
|
|
|
N_("Formatter"), WITHORSANS(formatter_gist), BLANKAFTER, NOVIEW);
|
2019-10-09 19:42:22 +02:00
|
|
|
#endif
|
|
|
|
}
|
2019-02-17 21:02:29 +01:00
|
|
|
#endif
|
2018-09-30 13:57:33 +02:00
|
|
|
#endif
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(do_savefile, MMAIN,
|
|
|
|
N_("Save"), WITHORSANS(savefile_gist), BLANKAFTER, NOVIEW);
|
2016-05-14 12:29:51 +02:00
|
|
|
|
2018-02-04 10:34:39 +01:00
|
|
|
add_to_funcs(flip_goto, MGOTOLINE,
|
2017-12-29 19:27:33 +01:00
|
|
|
N_("Go To Text"), WITHORSANS(whereis_gist), BLANKAFTER, VIEW);
|
2004-07-12 03:10:30 +00:00
|
|
|
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(dos_format_void, MWRITEFILE,
|
|
|
|
N_("DOS Format"), WITHORSANS(dos_gist), TOGETHER, NOVIEW);
|
|
|
|
add_to_funcs(mac_format_void, MWRITEFILE,
|
|
|
|
N_("Mac Format"), WITHORSANS(mac_gist), TOGETHER, NOVIEW);
|
|
|
|
|
|
|
|
/* If we're using restricted mode, the Append, Prepend, and Backup toggles
|
|
|
|
* are disabled. The first and second are not useful as they only allow
|
|
|
|
* reduplicating the current file, and the third is not allowed as it
|
|
|
|
* would write to a file not specified on the command line. */
|
|
|
|
if (!ISSET(RESTRICTED)) {
|
|
|
|
add_to_funcs(append_void, MWRITEFILE,
|
|
|
|
N_("Append"), WITHORSANS(append_gist), TOGETHER, NOVIEW);
|
|
|
|
add_to_funcs(prepend_void, MWRITEFILE,
|
|
|
|
N_("Prepend"), WITHORSANS(prepend_gist), TOGETHER, NOVIEW);
|
|
|
|
|
|
|
|
add_to_funcs(backup_file_void, MWRITEFILE,
|
|
|
|
N_("Backup File"), WITHORSANS(backup_gist), BLANKAFTER, NOVIEW);
|
|
|
|
}
|
2017-05-08 13:20:07 +02:00
|
|
|
#endif /* !NANO_TINY */
|
2017-05-01 20:20:34 +02:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2018-03-22 19:54:20 +01:00
|
|
|
/* Multiple buffers are only available when not in restricted mode. */
|
2017-12-29 19:27:33 +01:00
|
|
|
if (!ISSET(RESTRICTED))
|
|
|
|
add_to_funcs(flip_newbuffer, MINSERTFILE|MEXTCMD,
|
|
|
|
N_("New Buffer"), WITHORSANS(newbuffer_gist), TOGETHER, NOVIEW);
|
2002-03-21 05:07:28 +00:00
|
|
|
#endif
|
2018-09-08 12:23:39 +02:00
|
|
|
#ifndef NANO_TINY
|
2018-08-19 13:29:43 +02:00
|
|
|
add_to_funcs(flip_convert, MINSERTFILE,
|
|
|
|
N_("No Conversion"), WITHORSANS(convert_gist), TOGETHER, NOVIEW);
|
|
|
|
|
|
|
|
/* Command execution is only available when not in restricted mode. */
|
2019-03-31 20:05:30 +02:00
|
|
|
if (!ISSET(RESTRICTED) && !ISSET(VIEW_MODE)) {
|
2018-08-19 13:29:43 +02:00
|
|
|
add_to_funcs(flip_execute, MINSERTFILE,
|
|
|
|
N_("Execute Command"), WITHORSANS(execute_gist), TOGETHER, NOVIEW);
|
|
|
|
|
2018-05-15 22:20:11 -03:00
|
|
|
add_to_funcs(flip_pipe, MEXTCMD,
|
|
|
|
N_("Pipe Text"), WITHORSANS(pipe_gist), TOGETHER, NOVIEW);
|
2018-08-19 13:29:43 +02:00
|
|
|
|
|
|
|
add_to_funcs(flip_execute, MEXTCMD,
|
|
|
|
N_("Read File"), WITHORSANS(readfile_gist), TOGETHER, NOVIEW);
|
|
|
|
}
|
2018-05-23 11:57:55 +02:00
|
|
|
#endif
|
2017-05-08 19:08:23 +02:00
|
|
|
#ifdef ENABLE_BROWSER
|
2018-03-22 19:54:20 +01:00
|
|
|
/* The file browser is only available when not in restricted mode. */
|
2017-12-29 19:27:33 +01:00
|
|
|
if (!ISSET(RESTRICTED))
|
|
|
|
add_to_funcs(to_files_void, MWRITEFILE|MINSERTFILE,
|
|
|
|
N_("To Files"), WITHORSANS(tofiles_gist), TOGETHER, VIEW);
|
|
|
|
|
|
|
|
add_to_funcs(do_page_up, MBROWSER,
|
2018-07-30 20:45:15 +02:00
|
|
|
N_("Prev Page"), WITHORSANS(prevpage_gist), TOGETHER, VIEW);
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(do_page_down, MBROWSER,
|
2018-10-09 21:54:54 +02:00
|
|
|
N_("Next Page"), WITHORSANS(nextpage_gist), TOGETHER, VIEW);
|
2017-12-29 19:27:33 +01:00
|
|
|
|
|
|
|
add_to_funcs(to_first_file, MBROWSER|MWHEREISFILE,
|
|
|
|
N_("First File"), WITHORSANS(firstfile_gist), TOGETHER, VIEW);
|
|
|
|
add_to_funcs(to_last_file, MBROWSER|MWHEREISFILE,
|
|
|
|
N_("Last File"), WITHORSANS(lastfile_gist), BLANKAFTER, VIEW);
|
2016-05-17 12:48:47 +02:00
|
|
|
#ifndef NANO_TINY
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(do_prev_word_void, MBROWSER,
|
|
|
|
N_("Left Column"), WITHORSANS(browserlefthand_gist), TOGETHER, VIEW);
|
|
|
|
add_to_funcs(do_next_word_void, MBROWSER,
|
|
|
|
N_("Right Column"), WITHORSANS(browserrighthand_gist), TOGETHER, VIEW);
|
|
|
|
add_to_funcs(do_prev_block, MBROWSER,
|
|
|
|
N_("Top Row"), WITHORSANS(browsertoprow_gist), TOGETHER, VIEW);
|
|
|
|
add_to_funcs(do_next_block, MBROWSER,
|
|
|
|
N_("Bottom Row"), WITHORSANS(browserbottomrow_gist), BLANKAFTER, VIEW);
|
2016-05-02 09:34:23 +02:00
|
|
|
#endif
|
2017-08-19 18:11:59 +02:00
|
|
|
#endif /* ENABLE_BROWSER */
|
|
|
|
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(discard_buffer, MWRITEFILE,
|
|
|
|
N_("Discard buffer"), WITHORSANS(discardbuffer_gist), BLANKAFTER, NOVIEW);
|
2014-04-27 19:51:03 +00:00
|
|
|
|
2017-11-01 19:45:33 +01:00
|
|
|
#ifdef ENABLE_COLOR
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_funcs(do_page_up, MLINTER,
|
2019-09-24 17:07:15 +02:00
|
|
|
/* TRANSLATORS: The next two strings may be up to 37 characters each. */
|
2017-12-29 19:27:33 +01:00
|
|
|
N_("Prev Lint Msg"), WITHORSANS(prevlint_gist), TOGETHER, VIEW);
|
|
|
|
add_to_funcs(do_page_down, MLINTER,
|
|
|
|
N_("Next Lint Msg"), WITHORSANS(nextlint_gist), TOGETHER, VIEW);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Link key combos to functions in certain menus. */
|
2018-11-07 19:48:33 +01:00
|
|
|
add_to_sclist(MMOST|MBROWSER, "^M", 0, do_enter, 0);
|
|
|
|
add_to_sclist(MMOST|MBROWSER, "Enter", KEY_ENTER, do_enter, 0);
|
2018-12-23 18:04:02 +01:00
|
|
|
add_to_sclist(MMOST, "^H", BS_CODE, do_backspace, 0);
|
2018-11-07 19:48:33 +01:00
|
|
|
add_to_sclist(MMOST, "Bsp", KEY_BACKSPACE, do_backspace, 0);
|
|
|
|
add_to_sclist(MMOST, "Sh-Del", SHIFT_DELETE, do_backspace, 0);
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MMOST, "^D", 0, do_delete, 0);
|
|
|
|
add_to_sclist(MMOST, "Del", 0, do_delete, 0);
|
|
|
|
add_to_sclist(MMOST, "^I", 0, do_tab, 0);
|
|
|
|
add_to_sclist(MMOST, "Tab", TAB_CODE, do_tab, 0);
|
2019-12-15 19:47:05 +01:00
|
|
|
add_to_sclist((MMOST|MBROWSER) & ~MFINDINHELP, "^G", 0, do_help, 0);
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MMAIN|MHELP|MBROWSER, "^X", 0, do_exit, 0);
|
2018-12-03 09:44:03 +01:00
|
|
|
if (!ISSET(PRESERVE))
|
|
|
|
add_to_sclist(MMAIN, "^S", 0, do_savefile, 0);
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MMAIN, "^O", 0, do_writeout_void, 0);
|
|
|
|
add_to_sclist(MMAIN, "^R", 0, do_insertfile_void, 0);
|
|
|
|
add_to_sclist(MMAIN, "Ins", 0, do_insertfile_void, 0);
|
2018-12-03 09:44:03 +01:00
|
|
|
if (!ISSET(PRESERVE))
|
|
|
|
add_to_sclist(MMAIN|MHELP|MBROWSER, "^Q", 0, do_search_backward, 0);
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MMAIN|MHELP|MBROWSER, "^W", 0, do_search_forward, 0);
|
|
|
|
add_to_sclist(MMAIN, "^\\", 0, do_replace, 0);
|
|
|
|
add_to_sclist(MMAIN, "M-R", 0, do_replace, 0);
|
2019-05-03 19:51:15 +02:00
|
|
|
add_to_sclist(MMOST, "^K", 0, cut_text, 0);
|
2019-05-03 19:47:08 +02:00
|
|
|
add_to_sclist(MMOST, "^U", 0, paste_text, 0);
|
2017-10-31 17:34:07 +01:00
|
|
|
#ifdef ENABLE_JUSTIFY
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MMAIN, "^J", 0, do_justify_void, 0);
|
2014-05-03 19:19:31 +00:00
|
|
|
#endif
|
2017-10-31 19:32:42 +01:00
|
|
|
#ifdef ENABLE_SPELLER
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MMAIN, "^T", 0, do_spell, 0);
|
|
|
|
#endif
|
2018-09-23 16:15:55 +02:00
|
|
|
#ifdef ENABLE_COLOR
|
|
|
|
add_to_sclist(MMAIN, "M-B", 0, do_linter, 0);
|
2019-10-09 19:42:22 +02:00
|
|
|
#ifdef ENABLE_SPELLER
|
2019-10-25 17:17:48 +02:00
|
|
|
add_to_sclist(MMAIN, "M-F", 0, do_formatter, 0);
|
2019-10-09 19:42:22 +02:00
|
|
|
#endif
|
2017-12-29 19:27:33 +01:00
|
|
|
#endif
|
|
|
|
add_to_sclist(MMAIN, "^C", 0, do_cursorpos_void, 0);
|
2018-03-01 09:44:38 +01:00
|
|
|
add_to_sclist(MMAIN, "^_", 0, do_gotolinecolumn_void, 0);
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MMAIN, "M-G", 0, do_gotolinecolumn_void, 0);
|
|
|
|
add_to_sclist(MMAIN|MHELP|MBROWSER|MLINTER, "^Y", 0, do_page_up, 0);
|
2018-07-31 20:21:17 +02:00
|
|
|
add_to_sclist(MHELP|MBROWSER, "Bsp", KEY_BACKSPACE, do_page_up, 0);
|
2018-11-05 18:08:33 -06:00
|
|
|
add_to_sclist(MHELP|MBROWSER, "Sh-Del", SHIFT_DELETE, do_page_up, 0);
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MMAIN|MHELP|MBROWSER|MLINTER, "PgUp", KEY_PPAGE, do_page_up, 0);
|
|
|
|
add_to_sclist(MMAIN|MHELP|MBROWSER|MLINTER, "^V", 0, do_page_down, 0);
|
2018-07-31 20:21:17 +02:00
|
|
|
add_to_sclist(MHELP|MBROWSER, "Space", 0x20, do_page_down, 0);
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MMAIN|MHELP|MBROWSER|MLINTER, "PgDn", KEY_NPAGE, do_page_down, 0);
|
|
|
|
add_to_sclist(MMAIN|MHELP, "M-\\", 0, to_first_line, 0);
|
|
|
|
add_to_sclist(MMAIN|MHELP, "^Home", CONTROL_HOME, to_first_line, 0);
|
|
|
|
add_to_sclist(MMAIN|MHELP, "M-/", 0, to_last_line, 0);
|
|
|
|
add_to_sclist(MMAIN|MHELP, "^End", CONTROL_END, to_last_line, 0);
|
2018-07-27 20:07:15 +02:00
|
|
|
add_to_sclist(MMAIN|MHELP|MBROWSER, "M-W", 0, do_findnext, 0);
|
|
|
|
add_to_sclist(MMAIN|MHELP|MBROWSER, "M-Q", 0, do_findprevious, 0);
|
2016-09-08 21:00:51 +02:00
|
|
|
#ifndef NANO_TINY
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MMAIN, "M-]", 0, do_find_bracket, 0);
|
|
|
|
add_to_sclist(MMAIN, "M-A", 0, do_mark, 0);
|
|
|
|
add_to_sclist(MMAIN, "^6", 0, do_mark, 0);
|
|
|
|
add_to_sclist(MMAIN, "^^", 0, do_mark, 0);
|
2019-05-03 19:47:08 +02:00
|
|
|
add_to_sclist(MMAIN, "M-6", 0, copy_text, 0);
|
|
|
|
add_to_sclist(MMAIN, "M-^", 0, copy_text, 0);
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MMAIN, "M-}", 0, do_indent, 0);
|
2019-09-28 12:24:54 +02:00
|
|
|
add_to_sclist(MMAIN, "Tab", INDENT_KEY, do_indent, 0);
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MMAIN, "M-{", 0, do_unindent, 0);
|
|
|
|
add_to_sclist(MMAIN, "Sh-Tab", SHIFT_TAB, do_unindent, 0);
|
|
|
|
add_to_sclist(MMAIN, "M-:", 0, record_macro, 0);
|
|
|
|
add_to_sclist(MMAIN, "M-;", 0, run_macro, 0);
|
|
|
|
add_to_sclist(MMAIN, "M-U", 0, do_undo, 0);
|
|
|
|
add_to_sclist(MMAIN, "M-E", 0, do_redo, 0);
|
2019-02-24 17:27:22 +01:00
|
|
|
add_to_sclist(MMAIN, "Sh-^Del", CONTROL_SHIFT_DELETE, chop_previous_word, 0);
|
|
|
|
add_to_sclist(MMAIN, "^Del", CONTROL_DELETE, chop_next_word, 0);
|
2018-10-24 03:17:28 -06:00
|
|
|
add_to_sclist(MMAIN, "M-Del", ALT_DELETE, zap_text, 0);
|
2016-12-07 13:10:40 +01:00
|
|
|
#endif
|
|
|
|
#ifdef ENABLE_WORDCOMPLETION
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MMAIN, "^]", 0, complete_a_word, 0);
|
2016-05-25 22:13:50 +02:00
|
|
|
#endif
|
|
|
|
#ifdef ENABLE_COMMENT
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MMAIN, "M-3", 0, do_comment, 0);
|
2014-06-28 14:42:18 +00:00
|
|
|
#endif
|
2018-11-07 19:48:33 +01:00
|
|
|
add_to_sclist(MMOST|MBROWSER, "^B", 0, do_left, 0);
|
|
|
|
add_to_sclist(MMOST|MBROWSER, "^F", 0, do_right, 0);
|
2016-10-29 10:19:28 +02:00
|
|
|
#ifdef ENABLE_UTF8
|
2017-12-29 19:27:33 +01:00
|
|
|
if (using_utf8()) {
|
2018-11-07 19:48:33 +01:00
|
|
|
add_to_sclist(MMOST|MHELP|MBROWSER, "\xE2\x97\x80", KEY_LEFT, do_left, 0);
|
|
|
|
add_to_sclist(MMOST|MHELP|MBROWSER, "\xE2\x96\xb6", KEY_RIGHT, do_right, 0);
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MSOME, "^\xE2\x97\x80", CONTROL_LEFT, do_prev_word_void, 0);
|
|
|
|
add_to_sclist(MSOME, "^\xE2\x96\xb6", CONTROL_RIGHT, do_next_word_void, 0);
|
2019-05-13 12:07:32 +02:00
|
|
|
#if !defined(NANO_TINY) && defined(ENABLE_MULTIBUFFER)
|
2019-05-13 12:50:31 +02:00
|
|
|
if (!on_a_vt) {
|
|
|
|
add_to_sclist(MMAIN, "M-\xE2\x97\x80", ALT_LEFT, switch_to_prev_buffer, 0);
|
|
|
|
add_to_sclist(MMAIN, "M-\xE2\x96\xb6", ALT_RIGHT, switch_to_next_buffer, 0);
|
|
|
|
}
|
2017-12-29 19:27:33 +01:00
|
|
|
#endif
|
|
|
|
} else
|
|
|
|
#endif
|
|
|
|
{
|
2018-11-07 19:48:33 +01:00
|
|
|
add_to_sclist(MMOST|MHELP|MBROWSER, "Left", KEY_LEFT, do_left, 0);
|
|
|
|
add_to_sclist(MMOST|MHELP|MBROWSER, "Right", KEY_RIGHT, do_right, 0);
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MSOME, "^Left", CONTROL_LEFT, do_prev_word_void, 0);
|
|
|
|
add_to_sclist(MSOME, "^Right", CONTROL_RIGHT, do_next_word_void, 0);
|
2019-05-13 11:21:07 +02:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2019-05-13 12:50:31 +02:00
|
|
|
if (!on_a_vt) {
|
|
|
|
add_to_sclist(MMAIN, "M-Left", ALT_LEFT, switch_to_prev_buffer, 0);
|
|
|
|
add_to_sclist(MMAIN, "M-Right", ALT_RIGHT, switch_to_next_buffer, 0);
|
|
|
|
}
|
2019-05-13 11:21:07 +02:00
|
|
|
#endif
|
2017-12-29 19:27:33 +01:00
|
|
|
}
|
2018-12-10 11:09:36 +01:00
|
|
|
#ifdef NANO_TINY
|
|
|
|
add_to_sclist(MMAIN, "M-B", 0, do_prev_word_void, 0);
|
|
|
|
add_to_sclist(MMAIN, "M-D", 0, do_prev_word_void, 0);
|
|
|
|
add_to_sclist(MMAIN, "M-F", 0, do_next_word_void, 0);
|
|
|
|
add_to_sclist(MMAIN, "M-N", 0, do_next_word_void, 0);
|
|
|
|
#endif
|
2019-12-13 19:18:10 +01:00
|
|
|
add_to_sclist(MMOST, "M-Space", 0, do_prev_word_void, 0);
|
|
|
|
add_to_sclist(MMOST, "^Space", 0, do_next_word_void, 0);
|
2018-11-07 19:48:33 +01:00
|
|
|
add_to_sclist(MMOST, "^A", 0, do_home, 0);
|
|
|
|
add_to_sclist(MMOST, "Home", KEY_HOME, do_home, 0);
|
|
|
|
add_to_sclist(MMOST, "^E", 0, do_end, 0);
|
|
|
|
add_to_sclist(MMOST, "End", KEY_END, do_end, 0);
|
2018-03-12 18:28:44 +01:00
|
|
|
add_to_sclist(MMAIN|MHELP|MBROWSER, "^P", 0, do_up, 0);
|
|
|
|
add_to_sclist(MMAIN|MHELP|MBROWSER, "^N", 0, do_down, 0);
|
2016-10-29 10:19:28 +02:00
|
|
|
#ifdef ENABLE_UTF8
|
2017-12-29 19:27:33 +01:00
|
|
|
if (using_utf8()) {
|
2018-03-12 18:28:44 +01:00
|
|
|
add_to_sclist(MMAIN|MHELP|MBROWSER, "\xE2\x96\xb2", KEY_UP, do_up, 0);
|
|
|
|
add_to_sclist(MMAIN|MHELP|MBROWSER, "\xE2\x96\xbc", KEY_DOWN, do_down, 0);
|
2018-09-29 09:40:53 +02:00
|
|
|
add_to_sclist(MMAIN|MBROWSER|MLINTER, "^\xE2\x96\xb2", CONTROL_UP, do_prev_block, 0);
|
|
|
|
add_to_sclist(MMAIN|MBROWSER|MLINTER, "^\xE2\x96\xbc", CONTROL_DOWN, do_next_block, 0);
|
2017-12-29 19:27:33 +01:00
|
|
|
} else
|
|
|
|
#endif
|
|
|
|
{
|
2018-03-12 18:28:44 +01:00
|
|
|
add_to_sclist(MMAIN|MHELP|MBROWSER, "Up", KEY_UP, do_up, 0);
|
|
|
|
add_to_sclist(MMAIN|MHELP|MBROWSER, "Down", KEY_DOWN, do_down, 0);
|
2018-09-29 09:40:53 +02:00
|
|
|
add_to_sclist(MMAIN|MBROWSER|MLINTER, "^Up", CONTROL_UP, do_prev_block, 0);
|
|
|
|
add_to_sclist(MMAIN|MBROWSER|MLINTER, "^Down", CONTROL_DOWN, do_next_block, 0);
|
2017-12-29 19:27:33 +01:00
|
|
|
}
|
|
|
|
add_to_sclist(MMAIN, "M-7", 0, do_prev_block, 0);
|
|
|
|
add_to_sclist(MMAIN, "M-8", 0, do_next_block, 0);
|
2017-10-31 17:34:07 +01:00
|
|
|
#ifdef ENABLE_JUSTIFY
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MMAIN, "M-(", 0, do_para_begin_void, 0);
|
|
|
|
add_to_sclist(MMAIN, "M-9", 0, do_para_begin_void, 0);
|
|
|
|
add_to_sclist(MMAIN, "M-)", 0, do_para_end_void, 0);
|
|
|
|
add_to_sclist(MMAIN, "M-0", 0, do_para_end_void, 0);
|
2014-03-17 12:15:23 +00:00
|
|
|
#endif
|
2019-05-13 11:21:07 +02:00
|
|
|
#ifndef NANO_TINY
|
|
|
|
#ifdef ENABLE_UTF8
|
2018-12-16 09:34:08 +01:00
|
|
|
if (using_utf8()) {
|
|
|
|
add_to_sclist(MMAIN|MHELP, "M-\xE2\x96\xb2", ALT_UP, do_scroll_up, 0);
|
|
|
|
add_to_sclist(MMAIN|MHELP, "M-\xE2\x96\xbc", ALT_DOWN, do_scroll_down, 0);
|
2019-05-13 11:21:07 +02:00
|
|
|
} else
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
add_to_sclist(MMAIN|MHELP, "M-Up", ALT_UP, do_scroll_up, 0);
|
|
|
|
add_to_sclist(MMAIN|MHELP, "M-Down", ALT_DOWN, do_scroll_down, 0);
|
2018-12-16 09:34:08 +01:00
|
|
|
}
|
|
|
|
#endif
|
2019-02-24 11:23:48 +01:00
|
|
|
#if !defined(NANO_TINY) || defined(ENABLE_HELP)
|
2018-12-17 17:05:56 +01:00
|
|
|
add_to_sclist(MMAIN|MHELP, "M--", 0, do_scroll_up, 0);
|
|
|
|
add_to_sclist(MMAIN|MHELP, "M-_", 0, do_scroll_up, 0);
|
|
|
|
add_to_sclist(MMAIN|MHELP, "M-+", 0, do_scroll_down, 0);
|
|
|
|
add_to_sclist(MMAIN|MHELP, "M-=", 0, do_scroll_down, 0);
|
2006-03-30 07:03:04 +00:00
|
|
|
#endif
|
2017-05-01 20:20:34 +02:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MMAIN, "M-<", 0, switch_to_prev_buffer, 0);
|
|
|
|
add_to_sclist(MMAIN, "M-,", 0, switch_to_prev_buffer, 0);
|
|
|
|
add_to_sclist(MMAIN, "M->", 0, switch_to_next_buffer, 0);
|
|
|
|
add_to_sclist(MMAIN, "M-.", 0, switch_to_next_buffer, 0);
|
2008-03-05 07:34:01 +00:00
|
|
|
#endif
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MMOST, "M-V", 0, do_verbatim_input, 0);
|
2008-03-05 07:34:01 +00:00
|
|
|
#ifndef NANO_TINY
|
2019-05-03 19:51:15 +02:00
|
|
|
add_to_sclist(MMAIN, "M-T", 0, cut_till_eof, 0);
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MMAIN, "M-D", 0, do_wordlinechar_count, 0);
|
2014-04-07 09:44:52 +00:00
|
|
|
#endif
|
2017-10-31 17:34:07 +01:00
|
|
|
#ifdef ENABLE_JUSTIFY
|
2020-01-10 17:24:29 +01:00
|
|
|
if (!ISSET(VIEW_MODE))
|
|
|
|
add_to_sclist(MMAIN|MWHEREIS, "M-J", 0, do_full_justify, 0);
|
2011-02-07 14:45:56 +00:00
|
|
|
#endif
|
2018-12-03 09:44:03 +01:00
|
|
|
if (!ISSET(PRESERVE))
|
|
|
|
add_to_sclist(MMAIN|MHELP|MBROWSER, "^L", 0, total_refresh, 0);
|
|
|
|
else
|
|
|
|
add_to_sclist(MMAIN|MBROWSER, "^L", 0, total_refresh, 0);
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MMAIN, "^Z", 0, do_suspend_void, 0);
|
2014-04-06 08:57:36 +00:00
|
|
|
|
2014-05-03 19:19:31 +00:00
|
|
|
#ifndef NANO_TINY
|
2017-12-29 19:27:33 +01:00
|
|
|
/* Group of "Appearance" toggles. */
|
|
|
|
add_to_sclist(MMAIN, "M-X", 0, do_toggle_void, NO_HELP);
|
|
|
|
add_to_sclist(MMAIN, "M-C", 0, do_toggle_void, CONSTANT_SHOW);
|
2019-04-05 09:28:09 +02:00
|
|
|
add_to_sclist(MMAIN, "M-S", 0, do_toggle_void, SOFTWRAP);
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MMAIN, "M-$", 0, do_toggle_void, SOFTWRAP);
|
2016-10-20 09:44:29 +01:00
|
|
|
#ifdef ENABLE_LINENUMBERS
|
2019-04-05 09:28:09 +02:00
|
|
|
add_to_sclist(MMAIN, "M-N", 0, do_toggle_void, LINE_NUMBERS);
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MMAIN, "M-#", 0, do_toggle_void, LINE_NUMBERS);
|
2016-10-20 09:44:29 +01:00
|
|
|
#endif
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MMAIN, "M-P", 0, do_toggle_void, WHITESPACE_DISPLAY);
|
2017-11-01 19:45:33 +01:00
|
|
|
#ifdef ENABLE_COLOR
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MMAIN, "M-Y", 0, do_toggle_void, NO_COLOR_SYNTAX);
|
2014-05-09 12:20:20 +00:00
|
|
|
#endif
|
2014-05-03 19:19:31 +00:00
|
|
|
|
2017-12-29 19:27:33 +01:00
|
|
|
/* Group of "Editing-behavior" toggles. */
|
|
|
|
add_to_sclist(MMAIN, "M-H", 0, do_toggle_void, SMART_HOME);
|
|
|
|
add_to_sclist(MMAIN, "M-I", 0, do_toggle_void, AUTOINDENT);
|
|
|
|
add_to_sclist(MMAIN, "M-K", 0, do_toggle_void, CUT_FROM_CURSOR);
|
2017-10-29 21:00:09 +01:00
|
|
|
#ifdef ENABLE_WRAPPING
|
2019-01-29 20:03:59 +01:00
|
|
|
add_to_sclist(MMAIN, "M-L", 0, do_toggle_void, BREAK_LONG_LINES);
|
2014-05-09 12:20:20 +00:00
|
|
|
#endif
|
2018-07-13 13:57:06 +02:00
|
|
|
add_to_sclist(MMAIN, "M-O", 0, do_toggle_void, TABS_TO_SPACES);
|
2014-05-03 19:19:31 +00:00
|
|
|
|
2017-12-29 19:27:33 +01:00
|
|
|
/* Group of "Peripheral-feature" toggles. */
|
2017-05-01 20:45:07 +02:00
|
|
|
#ifdef ENABLE_MOUSE
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MMAIN, "M-M", 0, do_toggle_void, USE_MOUSE);
|
2014-05-09 12:20:20 +00:00
|
|
|
#endif
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MMAIN, "M-Z", 0, do_toggle_void, SUSPEND);
|
2014-03-17 14:15:57 +00:00
|
|
|
#endif /* !NANO_TINY */
|
2014-03-17 12:15:23 +00:00
|
|
|
|
2018-11-07 19:48:33 +01:00
|
|
|
add_to_sclist(((MMOST & ~MMAIN) | MYESNO), "^C", 0, do_cancel, 0);
|
2014-05-03 19:19:31 +00:00
|
|
|
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MWHEREIS|MREPLACE, "M-C", 0, case_sens_void, 0);
|
|
|
|
add_to_sclist(MWHEREIS|MREPLACE, "M-R", 0, regexp_void, 0);
|
|
|
|
add_to_sclist(MWHEREIS|MREPLACE, "M-B", 0, backwards_void, 0);
|
|
|
|
add_to_sclist(MWHEREIS|MREPLACE, "^R", 0, flip_replace, 0);
|
2018-02-04 10:34:39 +01:00
|
|
|
add_to_sclist(MWHEREIS|MGOTOLINE, "^T", 0, flip_goto, 0);
|
2017-10-29 19:42:12 +01:00
|
|
|
#ifdef ENABLE_HISTORIES
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE|MFINDINHELP|MEXTCMD, "^P", 0, get_history_older_void, 0);
|
|
|
|
add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE|MFINDINHELP|MEXTCMD, "^N", 0, get_history_newer_void, 0);
|
2017-04-09 16:30:38 -05:00
|
|
|
#ifdef ENABLE_UTF8
|
2017-12-29 19:27:33 +01:00
|
|
|
if (using_utf8()) {
|
|
|
|
add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE|MFINDINHELP|MEXTCMD, "\xE2\x96\xb2", KEY_UP, get_history_older_void, 0);
|
|
|
|
add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE|MFINDINHELP|MEXTCMD, "\xE2\x96\xbc", KEY_DOWN, get_history_newer_void, 0);
|
|
|
|
} else
|
2017-04-09 16:30:38 -05:00
|
|
|
#endif
|
2017-12-29 19:27:33 +01:00
|
|
|
{
|
|
|
|
add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE|MFINDINHELP|MEXTCMD, "Up", KEY_UP, get_history_older_void, 0);
|
|
|
|
add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE|MFINDINHELP|MEXTCMD, "Down", KEY_DOWN, get_history_newer_void, 0);
|
|
|
|
}
|
2019-02-12 19:18:11 +01:00
|
|
|
#endif
|
|
|
|
#ifdef ENABLE_JUSTIFY
|
|
|
|
add_to_sclist(MGOTOLINE, "^W", 0, do_para_begin_void, 0);
|
|
|
|
add_to_sclist(MGOTOLINE, "^O", 0, do_para_end_void, 0);
|
2014-05-03 19:19:31 +00:00
|
|
|
#endif
|
2019-02-12 19:01:35 +01:00
|
|
|
add_to_sclist(MGOTOLINE, "^Y", 0, to_first_line, 0);
|
|
|
|
add_to_sclist(MGOTOLINE, "^V", 0, to_last_line, 0);
|
2019-03-31 13:23:25 +02:00
|
|
|
/* Some people are used to having these keystrokes in the Search menu. */
|
|
|
|
add_to_sclist(MWHEREIS, "^Y", 0, to_first_line, 0);
|
|
|
|
add_to_sclist(MWHEREIS, "^V", 0, to_last_line, 0);
|
2017-05-08 19:08:23 +02:00
|
|
|
#ifdef ENABLE_BROWSER
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MWHEREISFILE, "^Y", 0, to_first_file, 0);
|
|
|
|
add_to_sclist(MWHEREISFILE, "^V", 0, to_last_file, 0);
|
|
|
|
add_to_sclist(MBROWSER|MWHEREISFILE, "M-\\", 0, to_first_file, 0);
|
|
|
|
add_to_sclist(MBROWSER|MWHEREISFILE, "M-/", 0, to_last_file, 0);
|
|
|
|
add_to_sclist(MBROWSER, "Home", KEY_HOME, to_first_file, 0);
|
|
|
|
add_to_sclist(MBROWSER, "End", KEY_END, to_last_file, 0);
|
|
|
|
add_to_sclist(MBROWSER, "^Home", CONTROL_HOME, to_first_file, 0);
|
|
|
|
add_to_sclist(MBROWSER, "^End", CONTROL_END, to_last_file, 0);
|
|
|
|
add_to_sclist(MBROWSER, "^_", 0, goto_dir_void, 0);
|
|
|
|
add_to_sclist(MBROWSER, "M-G", 0, goto_dir_void, 0);
|
|
|
|
#endif
|
2018-12-03 09:44:03 +01:00
|
|
|
if (ISSET(TEMP_FILE) && !ISSET(PRESERVE))
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MWRITEFILE, "^Q", 0, discard_buffer, 0);
|
2017-04-19 13:24:41 +02:00
|
|
|
#ifndef NANO_TINY
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MWRITEFILE, "M-D", 0, dos_format_void, 0);
|
|
|
|
add_to_sclist(MWRITEFILE, "M-M", 0, mac_format_void, 0);
|
2018-03-22 19:54:20 +01:00
|
|
|
/* Only when not in restricted mode, allow Appending, Prepending,
|
|
|
|
* making backups, and executing a command. */
|
2019-03-31 20:05:30 +02:00
|
|
|
if (!ISSET(RESTRICTED) && !ISSET(VIEW_MODE)) {
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MWRITEFILE, "M-A", 0, append_void, 0);
|
|
|
|
add_to_sclist(MWRITEFILE, "M-P", 0, prepend_void, 0);
|
|
|
|
add_to_sclist(MWRITEFILE, "M-B", 0, backup_file_void, 0);
|
|
|
|
add_to_sclist(MINSERTFILE|MEXTCMD, "^X", 0, flip_execute, 0);
|
|
|
|
}
|
2018-08-19 12:35:15 +02:00
|
|
|
add_to_sclist(MINSERTFILE, "M-N", 0, flip_convert, 0);
|
2017-04-19 13:24:41 +02:00
|
|
|
#endif
|
2017-05-08 13:20:07 +02:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2018-03-22 19:54:20 +01:00
|
|
|
/* Only when not in restricted mode, allow multiple buffers. */
|
2018-05-15 22:20:11 -03:00
|
|
|
if (!ISSET(RESTRICTED)) {
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MINSERTFILE|MEXTCMD, "M-F", 0, flip_newbuffer, 0);
|
2018-05-28 11:31:30 +02:00
|
|
|
#ifndef NANO_TINY
|
2018-05-15 22:20:11 -03:00
|
|
|
add_to_sclist(MEXTCMD, "M-\\", 0, flip_pipe, 0);
|
2018-05-28 11:31:30 +02:00
|
|
|
#endif
|
2018-05-15 22:20:11 -03:00
|
|
|
}
|
2017-05-08 13:20:07 +02:00
|
|
|
#endif
|
2017-05-08 19:08:23 +02:00
|
|
|
#ifdef ENABLE_BROWSER
|
2018-03-22 19:54:20 +01:00
|
|
|
/* Only when not in restricted mode, allow entering the file browser. */
|
2017-12-29 19:27:33 +01:00
|
|
|
if (!ISSET(RESTRICTED))
|
|
|
|
add_to_sclist(MWRITEFILE|MINSERTFILE, "^T", 0, to_files_void, 0);
|
2017-04-19 13:24:41 +02:00
|
|
|
#endif
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MHELP|MBROWSER, "^C", 0, do_exit, 0);
|
|
|
|
/* Allow exiting from the file browser and the help viewer with
|
|
|
|
* the same key as they were entered. */
|
2017-05-08 19:08:23 +02:00
|
|
|
#ifdef ENABLE_BROWSER
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MBROWSER, "^T", 0, do_exit, 0);
|
2015-11-08 19:40:13 +00:00
|
|
|
#endif
|
2017-04-25 17:51:45 +02:00
|
|
|
#ifdef ENABLE_HELP
|
2017-12-29 19:27:33 +01:00
|
|
|
add_to_sclist(MHELP, "^G", 0, do_exit, 0);
|
|
|
|
add_to_sclist(MHELP, "F1", 0, do_exit, 0);
|
|
|
|
add_to_sclist(MHELP, "Home", KEY_HOME, to_first_line, 0);
|
|
|
|
add_to_sclist(MHELP, "End", KEY_END, to_last_line, 0);
|
2016-10-15 17:55:19 +02:00
|
|
|
#endif
|
2018-09-24 21:29:44 +02:00
|
|
|
#ifdef ENABLE_COLOR
|
|
|
|
add_to_sclist(MLINTER, "^X", 0, do_cancel, 0);
|
|
|
|
#endif
|
2019-12-15 19:47:05 +01:00
|
|
|
add_to_sclist(MMOST & ~MFINDINHELP, "F1", 0, do_help, 0);
|
2018-10-07 14:42:42 +02:00
|
|
|
add_to_sclist(MMAIN|MHELP|MBROWSER, "F2", 0, do_exit, 0);
|
|
|
|
add_to_sclist(MMAIN, "F3", 0, do_writeout_void, 0);
|
|
|
|
#ifdef ENABLE_JUSTIFY
|
|
|
|
add_to_sclist(MMAIN, "F4", 0, do_justify_void, 0);
|
|
|
|
#endif
|
|
|
|
add_to_sclist(MMAIN, "F5", 0, do_insertfile_void, 0);
|
|
|
|
add_to_sclist(MMAIN|MHELP|MBROWSER, "F6", 0, do_search_forward, 0);
|
|
|
|
add_to_sclist(MMAIN|MHELP|MBROWSER|MLINTER, "F7", 0, do_page_up, 0);
|
|
|
|
add_to_sclist(MMAIN|MHELP|MBROWSER|MLINTER, "F8", 0, do_page_down, 0);
|
2019-05-03 19:51:15 +02:00
|
|
|
add_to_sclist(MMOST, "F9", 0, cut_text, 0);
|
2019-05-03 19:47:08 +02:00
|
|
|
add_to_sclist(MMOST, "F10", 0, paste_text, 0);
|
2018-10-07 14:42:42 +02:00
|
|
|
add_to_sclist(MMAIN, "F11", 0, do_cursorpos_void, 0);
|
|
|
|
#ifdef ENABLE_SPELLER
|
|
|
|
add_to_sclist(MMAIN, "F12", 0, do_spell, 0);
|
|
|
|
#endif
|
2002-04-23 10:56:06 +00:00
|
|
|
}
|
2002-02-27 04:14:16 +00:00
|
|
|
|
2008-03-05 07:34:01 +00:00
|
|
|
#ifndef NANO_TINY
|
2018-04-01 20:11:44 +02:00
|
|
|
/* Return the textual description that corresponds to the given flag. */
|
2009-11-29 06:13:22 +00:00
|
|
|
const char *flagtostr(int flag)
|
2004-07-12 03:10:30 +00:00
|
|
|
{
|
2017-12-29 19:27:33 +01:00
|
|
|
switch (flag) {
|
|
|
|
case NO_HELP:
|
2019-09-29 15:08:57 +02:00
|
|
|
/* TRANSLATORS: The next thirteen strings are toggle descriptions;
|
2017-12-29 19:27:33 +01:00
|
|
|
* they are best kept shorter than 40 characters, but may be longer. */
|
|
|
|
return N_("Help mode");
|
|
|
|
case CONSTANT_SHOW:
|
|
|
|
return N_("Constant cursor position display");
|
|
|
|
case SOFTWRAP:
|
|
|
|
return N_("Soft wrapping of overlong lines");
|
|
|
|
case WHITESPACE_DISPLAY:
|
|
|
|
return N_("Whitespace display");
|
|
|
|
case NO_COLOR_SYNTAX:
|
|
|
|
return N_("Color syntax highlighting");
|
|
|
|
case SMART_HOME:
|
|
|
|
return N_("Smart home key");
|
|
|
|
case AUTOINDENT:
|
|
|
|
return N_("Auto indent");
|
|
|
|
case CUT_FROM_CURSOR:
|
|
|
|
return N_("Cut to end");
|
2019-01-29 20:03:59 +01:00
|
|
|
case BREAK_LONG_LINES:
|
2017-12-29 19:27:33 +01:00
|
|
|
return N_("Hard wrapping of overlong lines");
|
|
|
|
case TABS_TO_SPACES:
|
|
|
|
return N_("Conversion of typed tabs to spaces");
|
|
|
|
case USE_MOUSE:
|
|
|
|
return N_("Mouse support");
|
|
|
|
case SUSPEND:
|
|
|
|
return N_("Suspension");
|
|
|
|
case LINE_NUMBERS:
|
|
|
|
return N_("Line numbering");
|
|
|
|
default:
|
|
|
|
return "Bad toggle -- please report a bug";
|
|
|
|
}
|
2008-03-05 07:34:01 +00:00
|
|
|
}
|
2014-03-17 14:15:57 +00:00
|
|
|
#endif /* !NANO_TINY */
|