** Open BUGS **
- Cutting the line at the top of the screen recenters to center (71)
- Many menu items are probably missing from the new backend (73)
-- Browser and prompt code still implement old switch on raw key input instead
- of new if block for subnfunc values (75)
-- New backend code probably does not compile under anything but default options,
- if that (76)
** Fixed BUGS **
- Marked cutting sometimes leaves a newline in the file unintelligently,
- F-keys do not work with new shortcut backend (72) [FIXED]
- Need a 'check-vitals-mapped' function to check that the end used didn't
unbind all the keys for exit or cancel before starting up the editor (74) [FIXED]
+- Browser and prompt code still implement old switch on raw key input instead
+ of new if block for subnfunc values (75) [FIXED]
+- New backend code probably does not compile under anything but default options,
+ if that (76) [FIXED]
- -enable-tiny does not work with new code (78) [FIXED]
- If a user only binds meta sequences to a function like left, right
page up/down, insert, and unbinds all other control and F keys for it,
context of menu \fImenu\fP. The format of \fIkey\fP should be one of:
.TP
.B ^
-followed by an alpha character or the word "Space"
+followed by an alpha character or the word "Space".
+Example: ^C
.TP
.B M-
-followed by a prinable character or the word "Space"
+followed by a prinable character or the word "Space".
+Example: M-C
.TP
-.B F#
+.B F
followed by a numeric value from 1-16
+Example: F10
.TP
Valid function names to be bound include:
-.TP
+.TP 3
.B help
-Invoke the help menu
+Invoke the help menu.
.TP
.B cancel
-Cancel the current command
+Cancel the current command.
.TP
.B exit
-Exit from the program
+Exit from the program.
.TP
.B writeout
-Write the current buffer to disk
+Write the current buffer to disk.
.TP
.B justify
-Justify text
+Justify the current text.
.TP
.B insert
-Insert a file into the current buffer (or a new buffer with multi-buffer enbled)
+Insert a file into the current buffer (or a new buffer with multi-buffer enbled).
.TP
.B whereis
-Search for text in the program
+Search for text in the program.
.TP
.B searchagain
-Repat the last search command
+Repat the last search command.
.TP
.B up
-Move up in the editor or browser
+Move up in the editor or browser.
.TP
.B down
-Move down in the editor or browser
+Move down in the editor or browser.
.TP
.B left
-Move left in the editor or browser
+Move left in the editor or browser.
.TP
.B right
-Move right in the editor or browser
+Move right in the editor or browser.
.TP
.B cut
-Cut the current line of text and store it
+Cut the current line of text and store it.
.TP
.B uncut
-Copy the currently stored text into the current file location
+Copy the currently stored text into the current file location.
.TP
.B curpos
-Show the current line, column, word positions in the file
+Show the current line, column, word positions in the file.
.TP
.B firstline
Move to the first line of the file
.TP
.B lastline
-Move to the last line of the file
+Move to the last line of the file.
.TP
.B gotoline
-Move to a specific line (and column if specified)
+Move to a specific line (and column if specified).
.TP
.B replace
-Interactively replace text within the editor
+Interactively replace text within the editor.
.TP
.B mark
-Begin selecting text for cutting or pasting at the current position
+Begin selecting text for cutting or pasting at the current position.
.TP
.B copytext
-Copy the currently marked text without deleting it
+Copy the currently marked text without deleting it.
.TP
.B indent
-Indent the currently marked text (shift to the right)
+Indent the currently marked text (shift to the right).
.TP
.B unindent
-Un-indent the currently marked text (shift to the left)
+Un-indent the currently marked text (shift to the left).
.TP
.B nextword
-Move the cursor to the beginning of the next word
+Move the cursor to the beginning of the next word.
.TP
.B prevword
-Move the cursor to the beginning of the previous word
+Move the cursor to the beginning of the previous word.
.TP
.B home
-Move the cursor to the beginning of the current line
+Move the cursor to the beginning of the current line.
.TP
.B end
-Move the cursor to the end of the current line
+Move the cursor to the end of the current line.
.TP
.B beginpara
Move the cursor to the beginning of the current paragraph
.TP
.B endpara
-Move the cursor to the beginning of the current paragraph
+Move the cursor to the beginning of the current paragraph.
.TP
.B findbracket
-Move the cursor to the matching bracket (brace, etc) of the one under the cursor
+Move the cursor to the matching bracket (brace, etc) of the one under the cursor.
.TP
.B scrollup
-Scroll up one line of text from the current position
+Scroll up one line of text from the current position.
.TP
.B scrolldown
-Scroll down one line of text from the current position
+Scroll down one line of text from the current position.
.TP
.B prevbuf
-Switch to editing/viewing the previous buffer when using multibuffer mode
+Switch to editing/viewing the previous buffer when using multibuffer mode.
.TP
.B nextbuf
-Switch to editing/viewing the next buffer when using multibuffer mode
+Switch to editing/viewing the next buffer when using multibuffer mode.
.TP
.B verbatim
-Insert the next character verbatim into the file
+Insert the next character verbatim into the file.
.TP
.B tab
-Insert a tab at the current cursor location
+Insert a tab at the current cursor location.
.TP
.B enter
-Insert a new line below the current one
+Insert a new line below the current one.
.TP
.B delete
-Delete the character under the cursor
+Delete the character under the cursor.
.TP
.B fulljustify
-Justify the entire current file
+Justify the entire current file.
.TP
.B wordcount
-Count the number of words in the current buffer
+Count the number of words in the current buffer.
.TP
.B refresh
Refresh the screen
.TP
+.B suspend
+Suspend the editor (if the suspend functino is enabled, see the
+"suspendenable" entry below.
+.TP
.B casesens
-Toggle case sensitivity in searching (search/replace menus only)
+Toggle case sensitivity in searching (search/replace menus only).
.TP
.B regexp
-Toggle whether searches/replaces are based on literal strings or regular expressions
+Toggle whether searches/replaces are based on literal strings or regular expressions.
.TP
.B prevhistory
-Show the previous history entry in the prompt menus (e.g. search)
+Show the previous history entry in the prompt menus (e.g. search).
.TP
.B nexthistory
-Show the next history entry in the prompt menus (e.g. search)
+Show the next history entry in the prompt menus (e.g. search).
.TP
.B dontreplace
-Switch back to searching instead of replacing
+Switch back to searching instead of replacing.
.TP
.B gototext
Search for files matching a string in the file browser (reading or writing files)
.TP
.B dosformat
-When writing a file, switch to writing a DOS format (CR/LF)
+When writing a file, switch to writing a DOS format (CR/LF).
.TP
.B macformat
-When writing a file, switch to writing a Mac format
+When writing a file, switch to writing a Mac format.
.TP
.B append
-When writing a file, append to the end instead of overwriting
+When writing a file, append to the end instead of overwriting.
.TP
.B prepend
-When writing a file, 'prepend' (write at the beginning) instead of overwriting
+When writing a file, 'prepend' (write at the beginning) instead of overwriting.
.TP
.B backup
-When writing a file, create a backup of the current file
+When writing a file, create a backup of the current file.
.TP
.B firstfile
-Move to the first file when using the file browser (reading or writing files)
+Move to the first file when using the file browser (reading or writing files).
.TP
.B lastfile
-Move to the last file when using the file browser (reading or writing files)
+Move to the last file when using the file browser (reading or writing files).
.TP
.B nohelp
-Toggle showing/hiding the two line list of key bindings at the bottom of the screen
+Toggle showing/hiding the two line list of key bindings at the bottom of the screen.
.TP
.B constupdate
-Constantly display the current line, column, etc position
+Constantly display the current line, column, etc position.
.TP
.B morespace
-Toggle showing/hiding the blank space which 'seperates' the 'title' from the file text
+Toggle showing/hiding the blank space which 'seperates' the 'title' from the file text.
.TP
.B smoothscroll
-Toggle smooth scrolling when moving via the arrow keys
+Toggle smooth scrolling when moving via the arrow keys.
.TP
.B whitesplacedisplay
.TP
.B smarthome
-Toggle whether the smart home key function is enabled
+Toggle whether the smart home key function is enabled.
.TP
.B autoindent
-Toggle whether new lines will conain the same amount of whitespace as the line above
+Toggle whether new lines will conain the same amount of whitespace as the line above.
.TP
.B cuttoend
-Toggle whether cutting text will cut the whole line or just from the current cursor
+Toggle whether cutting text will cut the whole line or just from the current cursor.
position to the end of the line
.TP
.B nowrap
Toggle whether long lines will be wrapped to the next line.
.TP
+.B suspendenable
+Toggle whether the suspend sequence (normally ^Z) will suspend the editor window.
+.TP
Valid menu sections are:
.TP
.B main
-The main editor window where text is entered
+The main editor window where text is entered.
.TP
.B search
-The search menu (AKA whereis)
+The search menu (AKA whereis).
.TP
.B replace
-The 'search to replace' menu
+The 'search to replace' menu.
.TP
.B replacewith
-The 'replace with' menu, which comes up after 'search to replace'
+The 'replace with' menu, which comes up after 'search to replace'.
.TP
.B gotoline
-The 'goto line (and column) menu
+The 'goto line (and column)' menu.
.TP
.B writeout
-The 'write file' menu
+The 'write file' menu.
.TP
.B insert
-The 'insert file' menu
+The 'insert file' menu.
.TP
.B extcmd
-The menu for inserting output from an external comman, reached from the insert menu
+The menu for inserting output from an external comman, reached from the insert menu.
.TP
.B help
-The help menu
+The help menu.
.TP
.B spell
-The interactive spell checker Yes/no menu
+The interactive spell checker Yes/no menu.
.TP
.B browser
-The file browser for inserting or writing a file
+The file browser for inserting or writing a file.
.TP
.B whereisfile
-The 'search for a file' menu in the file browser
+The 'search for a file' menu in the file browser.
.TP
.B gotodir
The 'go to directory' menu
.TP
.B all
-Special symbol for all menus (except the help menu)
+Special name meaning apply to all menus where this function exists.
.SH FILES
.TP
.I SYSCONFDIR/nanorc
FALSE,
#endif
MGOTODIR, ans,
+ &meta_key, &func_key,
#ifndef NANO_TINY
NULL,
#endif
TRUE,
#endif
MWHEREISFILE, backupstring,
+ &meta_key, &func_key,
#ifndef NANO_TINY
&search_history,
#endif
bool right_side_up = FALSE, single_line = FALSE;
#endif
+ currmenu = MINSERTFILE;
+
while (TRUE) {
#ifndef NANO_TINY
if (execute) {
execute ? MEXTCMD :
#endif
MINSERTFILE, ans,
+ &meta_key, &func_key,
+#ifndef DISABLE_OPERATINGDIR
#ifndef NANO_TINY
NULL,
#endif
edit_refresh, msg,
-#ifndef DISABLE_OPERATINGDIR
operating_dir != NULL && strcmp(operating_dir,
".") != 0 ? operating_dir :
#endif
#ifdef ENABLE_MULTIBUFFER
s = get_shortcut(currmenu, &i, &meta_key, &func_key);
- if (s && s->scfunc == (void *) do_toggle && s->toggle == MULTIBUFFER) {
+ if (s && s->scfunc == (void *) new_buffer_msg) {
/* Don't allow toggling if we're in view mode. */
if (!ISSET(VIEW_MODE))
TOGGLE(MULTIBUFFER);
TRUE,
#endif
MWRITEFILE, ans,
+ &meta_key, &func_key,
#ifndef NANO_TINY
NULL,
#endif
no_replace_msg, IFSCHELP(nano_whereis_msg), FALSE, VIEW);
add_to_funcs((void *) gototext_msg, MGOTOLINE,
- gototext_msg, IFSCHELP(nano_whereis_msg), FALSE, VIEW);
+ gototext_msg, IFSCHELP(nano_whereis_msg), TRUE, VIEW);
#ifndef DISABLE_BROWSER
if (!ISSET(RESTRICTED))
/* If we're using restricted mode, the multibuffer toggle is
* disabled. It's useless since inserting files is disabled. */
if (!ISSET(RESTRICTED))
- add_to_funcs((void *) new_buffer_msg, MWRITEFILE,
+ add_to_funcs((void *) new_buffer_msg, MINSERTFILE,
new_buffer_msg, nano_multibuffer_msg, FALSE, NOVIEW);
#endif
add_to_sclist(MMAIN, "M-.", switch_to_next_buffer_void, 0, TRUE);
#endif
add_to_sclist(MMAIN, "M-V", do_verbatim_input, 0, TRUE);
- add_to_sclist(MALL, "^I", do_tab, 0, TRUE);
- add_to_sclist(MALL, "^M", do_enter, 0, TRUE);
- add_to_sclist(MALL, "kenter", do_enter, 0, TRUE);
- add_to_sclist(MALL, "^D", do_delete, 0, TRUE);
- add_to_sclist(MALL, "kdel", do_delete, 0, TRUE);
- add_to_sclist(MALL, "^H", do_backspace, 0, TRUE);
- add_to_sclist(MALL, "kbsp", do_backspace, 0, TRUE);
#ifndef NANO_TINY
add_to_sclist(MALL, "M-T", do_cut_till_end, 0, TRUE);
add_to_sclist(MALL, "M-J", do_full_justify, 0, TRUE);
- add_to_sclist(MALL, "M-D", do_wordlinechar_count, 0, TRUE);
+ add_to_sclist(MMAIN, "M-D", do_wordlinechar_count, 0, TRUE);
add_to_sclist(MMAIN, "M-X", do_toggle, NO_HELP, TRUE);
add_to_sclist(MMAIN, "M-C", do_toggle, CONST_UPDATE, TRUE);
add_to_sclist(MMAIN, "M-O", do_toggle, MORE_SPACE, TRUE);
add_to_sclist(MMAIN, "M-N", do_toggle, NO_CONVERT, TRUE);
add_to_sclist(MMAIN, "M-Z", do_toggle, SUSPEND, TRUE);
#endif
+ add_to_sclist(MGOTOLINE, "^T", (void *) gototext_msg, 0, FALSE);
+ add_to_sclist(MINSERTFILE|MEXTCMD, "M-F", (void *) new_buffer_msg, 0, FALSE);
add_to_sclist((MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE|MWRITEFILE|MINSERTFILE|MEXTCMD|MSPELL|MWHEREISFILE|MGOTODIR),
"^C", (void *) cancel_msg, 0, FALSE);
add_to_sclist(MHELP, "^X", do_exit, 0, TRUE);
add_to_sclist(MINSERTFILE, "^X", (void *) ext_cmd_msg, 0, FALSE);
add_to_sclist(MMAIN, "^Z", do_suspend_void, 0, FALSE);
add_to_sclist(MMAIN, "^L", total_refresh, 0, TRUE);
+ add_to_sclist(MALL, "^I", do_tab, 0, TRUE);
+ add_to_sclist(MALL, "^M", do_enter, 0, TRUE);
+ add_to_sclist(MALL, "kenter", do_enter, 0, TRUE);
+ add_to_sclist(MALL, "^D", do_delete, 0, TRUE);
+ add_to_sclist(MALL, "kdel", do_delete, 0, TRUE);
+ add_to_sclist(MALL, "^H", do_backspace, 0, TRUE);
+ add_to_sclist(MALL, "kbsp", do_backspace, 0, TRUE);
#ifdef DEBUG
print_sclist();
bool allow_files,
#endif
const char *curranswer,
+ bool *meta_key, bool *func_key,
#ifndef NANO_TINY
filestruct **history_list,
#endif
)
{
int kbinput = ERR;
- bool meta_key, func_key, have_shortcut, ran_func, finished;
+ bool have_shortcut, ran_func, finished;
size_t curranswer_len;
const sc *s;
#ifndef DISABLE_TABCOMP
* this case, disable all keys that would change the text if the
* filename isn't blank and we're at the "Write File" prompt. */
while (1) {
- kbinput = do_statusbar_input(&meta_key, &func_key, &have_shortcut,
+ kbinput = do_statusbar_input(meta_key, func_key, &have_shortcut,
&ran_func, &finished, TRUE, refresh_func);
assert(statusbar_x <= strlen(answer));
- s = get_shortcut(currmenu, &kbinput, &meta_key, &func_key);
+ s = get_shortcut(currmenu, &kbinput, meta_key, func_key);
if (s)
if (s->scfunc == (void *) cancel_msg || s->scfunc == do_enter)
bool allow_files,
#endif
int menu, const char *curranswer,
+ bool *meta_key, bool *func_key,
#ifndef NANO_TINY
filestruct **history_list,
#endif
allow_files,
#endif
curranswer,
+ meta_key, func_key,
#ifndef NANO_TINY
history_list,
#endif
bool allow_files,
#endif
const char *curranswer,
+ bool *meta_key, bool *func_key,
#ifndef NANO_TINY
filestruct **history_list,
#endif
bool allow_files,
#endif
int menu, const char *curranswer,
+ bool *meta_key, bool *func_key,
#ifndef NANO_TINY
filestruct **history_list,
#endif
const char *append_msg;
const char *prepend_msg;
const char *backup_file_msg;
-
+const char *gototext_msg;
+const char *new_buffer_msg;
#ifdef HAVE_REGEX_H
const char *regexp_msg;
char *buf;
sc *s;
void *func = NULL;
+ bool meta_key = FALSE, func_key = FALSE;
static char *backupstring = NULL;
/* The search string we'll be using. */
TRUE,
#endif
replacing ? MREPLACE : MWHEREIS, backupstring,
+ &meta_key, &func_key,
#ifndef NANO_TINY
&search_history,
#endif
{
filestruct *edittop_save, *begin;
size_t begin_x, pww_save;
+ bool meta_key = FALSE, func_key = FALSE;
ssize_t numreplaced;
int i;
TRUE,
#endif
MREPLACE2, last_replace,
+ &meta_key, &func_key,
#ifndef NANO_TINY
&replace_history,
#endif
void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
bool interactive, bool save_pos, bool allow_update)
{
- bool meta_key, func_key;
+ bool meta_key = FALSE, func_key = FALSE;
const sc *s;
if (interactive) {
TRUE,
#endif
MGOTOLINE, use_answer ? ans : "",
+ &meta_key, &func_key,
#ifndef NANO_TINY
NULL,
#endif
s = get_shortcut(currmenu, &i, &meta_key, &func_key);
- if (s && s->scfunc == do_search) {
+ if (s && s->scfunc == (void *) gototext_msg) {
/* Keep answer up on the statusbar. */
search_init(TRUE, TRUE);
char *save_search, *save_replace;
size_t match_len, current_x_save = openfile->current_x;
size_t pww_save = openfile->placewewant;
+ bool meta_key = FALSE, func_key = FALSE;
filestruct *edittop_save = openfile->edittop;
filestruct *current_save = openfile->current;
/* Save where we are. */
TRUE,
#endif
MSPELL, word,
+ &meta_key, &func_key,
#ifndef NANO_TINY
NULL,
#endif