diff --git a/ChangeLog b/ChangeLog index b8222ce4..6a42661f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,10 @@ * src/proto.h, src/global.c, src/search.c: Rename 'no_replace_void()' to 'flip_replace_void()', to show what it actually does. * doc/man/nanorc.5, doc/texinfo/nano.texi: Update the docs for that. + * src/global.c (strtosc): Add the bindable function 'gotodir'. + * doc/man/nanorc.5, doc/texinfo/nano.texi: Document the bindable + functions 'tofiles','gotodir' and 'flipnewbuffer', and correct + the description of 'gototext' (not being about the file browser). 2014-06-22 Benno Schulenberg * src/browser.c (parse_browser_input), src/help.c (parse_help_input): diff --git a/doc/man/nanorc.5 b/doc/man/nanorc.5 index 5ba4f731..87b7ea86 100644 --- a/doc/man/nanorc.5 +++ b/doc/man/nanorc.5 @@ -364,7 +364,8 @@ Inserts a file into the current buffer (or into a new buffer when multibuffer is enabled). .TP .B whereis -Searches for text in the current buffer. +Searches for text in the current buffer -- or for filenames matching +a string in the current list in the file browser. .TP .B searchagain Repeats the last search command. @@ -461,6 +462,9 @@ Goes to the last line of the file. .B gotoline Goes to a specific line (and column if specified). .TP +.B gototext +Switches from targetting a line number to searching for text. +.TP .B findbracket Moves the cursor to the bracket (brace, parenthesis, etc.) that matches (pairs) with the one under the cursor. @@ -520,8 +524,16 @@ Toggles between searching for something and replacing something. .B flipexecute Toggles between inserting a file and executing a command. .TP -.B gototext -Searches for files matching a string in the file browser (reading or writing files). +.B flipnewbuffer +Toggles between inserting into the current buffer and into a new +empty buffer. +.TP +.B tofiles +Starts the file browser, allowing to select a file from a list. +.TP +.B gotodir +Goes to a directory to be specified, allowing to browse anywhere +in the filesystem. .TP .B dosformat When writing a file, switches to writing a DOS format (CR/LF). diff --git a/doc/texinfo/nano.texi b/doc/texinfo/nano.texi index 0ee18746..b79098a2 100644 --- a/doc/texinfo/nano.texi +++ b/doc/texinfo/nano.texi @@ -890,7 +890,8 @@ Inserts a file into the current buffer (or into a new buffer when multibuffer is enabled). @item whereis -Searches for text in the current buffer. +Searches for text in the current buffer -- or for filenames matching +a string in the current list in the file browser @item searchagain Repeats the last search command. @@ -987,6 +988,9 @@ Goes to the last line of the file. @item gotoline Goes to a specific line (and column if specified). +@item gototext +Switches from targetting a line number to searching for text. + @item findbracket Moves the cursor to the bracket (brace, parenthesis, etc.) that matches (pairs) with the one under the cursor. @@ -1046,8 +1050,9 @@ Toggles between searching for something and replacing something. @item flipexecute Toggles between inserting a file and executing a command. -@item gototext -Searches for files matching a string in the file browser (reading or writing files). +@item flipnewbuffer +Toggles between inserting into the current buffer and into a new +empty buffer. @item dosformat When writing a file, switches to writing a DOS format (CR/LF). @@ -1064,6 +1069,13 @@ When writing a file, 'prepends' (writes at the beginning) instead of overwriting @item backup When writing a file, creates a backup of the current file. +@item tofiles +Starts the file browser, allowing to select a file from a list. + +@item gotodir +Goes to a directory to be specified, allowing to browse anywhere +in the filesystem. + @item firstfile Goes to the first file when using the file browser (reading or writing files). diff --git a/src/global.c b/src/global.c index 36a2c63f..11c460a5 100644 --- a/src/global.c +++ b/src/global.c @@ -1480,12 +1480,6 @@ sc *strtosc(char *input) } else if (!strcasecmp(input, "gototext")) { s->scfunc = gototext_void; s->execute = FALSE; -#ifndef DISABLE_BROWSER - } else if (!strcasecmp(input, "browser") || - !strcasecmp(input, "tofiles")) { - s->scfunc = to_files_void; - s->execute = FALSE; -#endif } else if (!strcasecmp(input, "dosformat")) { s->scfunc = dos_format_void; s->execute = FALSE; @@ -1507,11 +1501,19 @@ sc *strtosc(char *input) s->execute = FALSE; #endif #ifndef DISABLE_MULTIBUFFER - } else if (!strcasecmp(input, "newbuffer")) { + } else if (!strcasecmp(input, "flipnewbuffer") || + !strcasecmp(input, "newbuffer")) { s->scfunc = new_buffer_void; s->execute = FALSE; #endif #ifndef DISABLE_BROWSER + } else if (!strcasecmp(input, "tofiles") || + !strcasecmp(input, "browser")) { + s->scfunc = to_files_void; + s->execute = FALSE; + } else if (!strcasecmp(input, "gotodir")) { + s->scfunc = goto_dir_void; + s->execute = FALSE; } else if (!strcasecmp(input, "firstfile")) { s->scfunc = do_first_file; s->execute = FALSE;