David Lawrence Ramsey
2367f3d8e6
text: make do_unindent() an exact copy of do_indent()
...
This is the first step toward splitting them into two dedicated
functions, instead of letting do_indent() handle both cases.
2017-07-12 16:45:41 +02:00
Benno Schulenberg
78bc8b698c
tweaks: avoid a clang warning about an expression being treated as NULL
...
When compiling with 'clang', it would say: warning: expression which
evaluates to zero treated as a null pointer constant of type 'char *'.
2017-07-10 10:34:16 +02:00
David Lawrence Ramsey
6295cca03b
tweaks: correct a parameter type, and correct two empty initializations
...
This avoids some warnings when compiled with -pedantic:
ISO C forbids comparison of ‘void *’ with function pointer
ISO C forbids empty initializer braces
2017-07-03 09:40:55 +02:00
Benno Schulenberg
16482f99b8
tweaks: unglobalize the nodelay_mode variable
2017-06-04 12:15:26 +02:00
Benno Schulenberg
621eb904b3
bindings: in the tiny version exclude word jumping from the prompts
...
In the tiny version, Ctrl+Left and Ctrl+Right are available only
in the editor itself and in the file browser.
This fixes https://savannah.gnu.org/bugs/?51173 .
2017-06-04 11:13:03 +02:00
Benno Schulenberg
6ad3d3d6c0
display: show the cursor position also when searching took a while
...
Achieve this by making the suppression flag global, so that we can
just reset it instead of making an improper call of do_cursorpos().
This fixes the secondary part of https://savannah.gnu.org/bugs/?51134 .
2017-05-29 22:15:38 +02:00
Benno Schulenberg
f1a47a2aae
tweaks: reshuffle a few things to reduce duplication
...
It is no longer necessary to assign up() and down() separately for
the help viewer because by now the movement keys have been sorted
in order of ascending stride also in the main menu.
The two string definitions are relocated just to reduce the number
of #ifdefs.
2017-05-19 17:57:39 +02:00
Benno Schulenberg
9ce41543ed
startup: don't call delwin() with NULL, to avoid crashing on Solaris
...
Apparently the curses on SunOS is less forgiving than the one on GNU.
Or rather: delwin(NULL) should just return an error, it shouldn't crash.
This fixes https://savannah.gnu.org/bugs/?51053 .
Reported-by: John Wiersba <jrw32982@yahoo.com>
Solved-by: John Wiersba <jrw32982@yahoo.com>
2017-05-18 10:26:11 +02:00
Benno Schulenberg
858e75e4cf
tweaks: transform the token DISABLE_NANORC to ENABLE_NANORC
...
Also, allow rebinding the word and block jumping functions
in the tiny version when nanorc files are reenabled.
2017-05-09 11:59:34 +02:00
Benno Schulenberg
00533854c0
tweaks: fix compilation with --enable-tiny ...-help and ...-multibuffer
...
(This should have been part of 9ea5eef2
, four commits ago.)
2017-05-08 22:01:34 +02:00
Benno Schulenberg
dc3610fc8e
tweaks: transform the token DISABLE_BROWSER to ENABLE_BROWSER
...
Also, allow Ctrl+Left/Right with --enable-tiny --enable-browser.
2017-05-08 21:56:50 +02:00
Benno Schulenberg
509b091c47
tweaks: rename three empty functions, and reshuffle some others
...
Also remove a superfluous check for 'do_replace' -- it never gets
bound in the Search/Replace menus.
2017-05-08 14:33:18 +02:00
Benno Schulenberg
9ea5eef200
bindings: allow toggling a new buffer when multiple buffers are enabled
...
When configured with --enable-tiny --enable-multibuffer,
/do/ include the new-buffer toggle in the Read-File menu.
2017-05-08 13:36:57 +02:00
Benno Schulenberg
e701bb01aa
tweaks: remove five dummy function definitions from the tiny version
2017-05-08 13:04:26 +02:00
David Lawrence Ramsey
03c3e2b7c0
tweaks: fix several whitespace irregularities
...
Add missing spaces, remove excess spaces, and
replace groups of indentation spaces with tabs.
2017-05-07 18:20:01 +02:00
Benno Schulenberg
9c2bc68847
help: after a search, show the cursor only when something was found
...
And hide the cursor again as soon as the user scrolls.
Achieve this through making the 'didfind' variable global.
Also, remove a superfluous call of wnoutrefresh(), as bottombars()
already does that.
This fixes https://savannah.gnu.org/bugs/?50918 .
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>
2017-05-03 17:02:49 +02:00
Benno Schulenberg
3d1ef8e07f
bindings: show Home and End in browser help text, instead of M-| and M-?
2017-05-02 17:56:08 +02:00
Benno Schulenberg
5033cfd81a
tweaks: transform the token DISABLE_MOUSE to ENABLE_MOUSE
...
Also, trim some comments and avoid an unused-variable warning.
2017-05-01 20:53:07 +02:00
Benno Schulenberg
9c3a149b14
tweaks: transform the token DISABLE_MULTIBUFFER to ENABLE_MULTIBUFFER
2017-05-01 20:20:34 +02:00
Benno Schulenberg
3275c4e514
display: initialize the colors only when starting to draw the content
...
This avoids https://savannah.gnu.org/bugs/?49912 while at the same time
avoiding to draw the edit window twice in a row -- the first drawing
would use a wrong margin, which results in a visible and irritating
shift left or right of the content upon the second drawing.
This fixes https://savannah.gnu.org/bugs/?50877 .
2017-04-30 17:29:17 +02:00
Benno Schulenberg
81aebeb2a9
bindings: allow using <Backspace> to scroll back up in the help viewer
...
Backspace is a more logical counterpart of Space than minus.
2017-04-26 15:14:28 +02:00
Benno Schulenberg
a832fffb1f
browser: make ^End work properly by fixing a paste error
...
It complained of "Unbound key" until now.
2017-04-26 10:05:18 +02:00
Benno Schulenberg
99fa20645c
tweaks: avoid an unused-variable warning
...
That is: nest the conditions consistently.
And in the bargain rename the variable.
2017-04-25 20:57:22 +02:00
Benno Schulenberg
46430999d5
build: make --enable-help properly depend on --enable-multibuffer
...
And in the process transform the token DISABLE_HELP to ENABLE_HELP.
2017-04-25 18:27:55 +02:00
Rishabh Dave
90bd25c1bb
new feature: add a search facility to the help viewer
...
Allow the user to search in a help text with ^W and M-W.
Achieve this by not writing the help text directly to the screen
but first writing it to a temporary file and then opening this file
in a new buffer, and treating it specially: the normal file-reading
feedback is suppressed, the titlebar shows the headline of the text,
the cursor is hidden, and the menu is limited to just the up and down
movements and searching.
This fulfills https://savannah.gnu.org/bugs/?28994 .
Signed-off-by: Rishabh Dave <rishabhddave@gmail.com>
2017-04-25 17:20:34 +02:00
Benno Schulenberg
3c875f9b59
tweaks: complete the exclusion of backups and such from the tiny version
...
File formats, appending and prepending, and backups are not available
when --enable-tiny is used, so prevent all relevant pieces of code from
getting compiled. And correct two misspelled ENABLE_TINY to NANO_TINY.
2017-04-19 13:30:43 +02:00
Benno Schulenberg
74f128859b
tweaks: rename a constant, to match the corresponding option
2017-04-17 11:51:48 +02:00
Benno Schulenberg
5aa12a2b3d
tweaks: group ^D and ^H together in the help lines
...
This also groups ^I and ^M together, and cutwordleft and cutwordright
(when they are bound). It furthermore makes that less pairs are now
mixed and instead consist of either two Ctrl or two Meta combos. In
short: it looks better in the default config. The only sacrifice is
that Verbatim is now split off from the other "inserting" keys.
2017-04-11 13:23:43 +02:00
David Lawrence Ramsey
02376103eb
bindings: use arrows instead of words for search history too
...
When UTF-8 is available, use actual arrows instead of untranslated words
to indicate the cursor keys in the search history, as is done elsewhere.
2017-04-10 16:19:37 +02:00
Benno Schulenberg
754c62c5cc
copyright: update the years, use ranges, and explain this usage
...
The interval 2013-2017 for the Free Software Foundation is valid
because in those years there were releases with changes by either
Chris or David, and the GNU maintainers guide advises to mention
a new year in all files of a package, not just in the ones that
actually changed, and be done with it for the rest of the year.
2017-04-09 12:09:23 +02:00
Benno Schulenberg
bf00e3f606
tweaks: put M-A before ^6, to look better above M-6 in the help lines
...
Also, M-A is far more mnemonic for setting the mark than ^6 or ^^,
so it's better to try and teach the user that.
2017-04-07 20:07:37 +02:00
Benno Schulenberg
cb0806b2a0
bindings: make ^Home and ^End go to top and tail of buffer
...
On some terminal emulators, Ctrl+Home and Ctrl+End produce special
keycodes, distinct from plain Home and End. Make the users of those
emulators (and of the Linux console) glad by making ^Home and ^End
do the obvious thing, and the combinations with Shift too.
2017-04-06 21:19:00 +02:00
Benno Schulenberg
8fc72eb32b
bindings: use arrows instead of words to designate the cursor keys
...
When UTF-8 is available, use actual arrows instead of untranslated words
to indicate the cursor keys. This was already done for the combinations
with Ctrl but not yet for the plain cursor keys.
2017-04-04 20:53:08 +02:00
Benno Schulenberg
6b5aff4878
tweaks: put unshifted shortcuts ^6 and M-6 first, instead of ^^ and M-^
...
The unshifted shortcuts are easier to type, and also less confusing in
my eyes. Putting them first means they get shown in the help lines,
and get listed first in the ^G help text.
(I would also like to put ^- first instead of ^_ (because the latter
is hard to see when using the default inverse video for shortcuts),
but on several terminal emulators Ctrl+- reduces the font size.)
2017-04-04 20:41:09 +02:00
Benno Schulenberg
fb534bada6
bindings: make ^Up/^Down go to first/last row in the file browser
...
Making ^Up and ^Down go to top and bottom row in the file browser
complements and completes the behavior of ^Left and ^Right.
2017-04-04 20:26:21 +02:00
Benno Schulenberg
c01d6a8f74
tweaks: reshuffle the bindings to group things more logically
...
Put all the movement keys together, in order of ascending stride.
Also, move the Undo/Redo keystrokes further up, so that, when the
user has a somewhat wider terminal than the usual 80 characters,
these keystrokes will be shown -- they are far more interesting
than the ^Y and ^V ones, for which PgUp and PgDn can be used.
2017-03-23 11:37:36 +01:00
David Lawrence Ramsey
812ecaeb0c
weeding: remove maxlines and related code
...
Since all lines can be partially scrolled off the screen now
(except for edittop, which is forthcoming), the maxlines global
variable and its computation mechanism are no longer needed.
2017-03-22 10:44:05 +01:00
David Lawrence Ramsey
d8189703b1
tweaks: prepare for improvements to do_home() and do_end()
...
These improvements will eventually make do_home() and do_end() take
parameters. Since the global function lists can hold only functions
without parameters, preemptively add do_home_void() and do_end_void(),
and make the global function lists use them.
2017-03-22 10:44:04 +01:00
Benno Schulenberg
9b336a9d66
bindings: group the three search-again shortcuts together
2017-03-20 15:59:41 +01:00
Hans-Bernhard Broeker
636b7348a6
tweaks: make sure calls to <ctype.h> functions/macros use "unsigned char"
...
The platform's default char type might be signed, which could cause
problems in 8-bit locales.
This addresses https://savannah.gnu.org/bugs/?50289 .
Reported-by: Hans-Bernhard Broeker <HBBroeker@T-Online.de>
2017-03-06 20:58:25 +01:00
Mike Frysinger
3deec4352b
assume regex.h support is always available
...
Now that we pull in the gnulib regex module, we can assume it exists.
2017-03-06 12:01:08 +01:00
Benno Schulenberg
3d9a4d6257
tweaks: make WhereIsNext available in browser in tiny version
...
Also, avoid a warning with with --enable-tiny --enable-browser.
2017-02-27 19:22:50 +01:00
Benno Schulenberg
eb67af9347
tweaks: fix compilation with --enable-tiny --enable-help
2017-02-27 19:10:39 +01:00
Benno Schulenberg
0208ae7149
tweaks: rename a variable -- lines refers to buffer, rows to screen
2017-01-12 17:33:46 +01:00
Benno Schulenberg
eef7d1047a
screen: display byte value 0x0A in the right places as ^@ or as ^J
...
In path names and file names, 0x0A means an embedded newline and
should be shown as ^J, but in anything related to the file's data,
0x0A is an encoded NUL and should be displayed as ^@.
So... switch mode at the two main entry points into the "file system"
(reading in a file, and writing out a file), and also when drawing the
titlebar. Switch back to the default mode in the main loop.
This fixes https://savannah.gnu.org/bugs/?49893 .
2016-12-23 11:00:55 +01:00
Benno Schulenberg
a9b5a0e029
tweaks: rename a function to something less abbrevy
...
Also, swap the logic around, to use less braces.
2016-12-22 12:04:10 +01:00
Benno Schulenberg
b77e6bd99d
general: simplify the detection of a SIGWINCH
...
There is no need for a counter, nor an old counter to compare it with.
2016-12-19 10:04:01 +01:00
David Lawrence Ramsey
c9f743f676
tweaks: elide two unneeded variables from line numbering mode
...
Instead compute directly whether we're at a softwrapped part or not.
2016-12-13 17:01:39 +01:00
Benno Schulenberg
964c10db17
tweaks: miscellaneous frobbings and rewrappings
2016-12-07 20:37:08 +01:00
Benno Schulenberg
0e01080983
binding: allow to rebind the word-completion function, and document it
2016-12-07 17:18:56 +01:00
Benno Schulenberg
68a0314500
build: add configure option --disable-wordcomp to disable word completion
...
(The variable 'pletion_line' is not conditionalized with this option, as
it would become messy. The compiler will probably be able to elide it.)
When using --enable-tiny, it is not possible to use --enable-wordcomp,
because the word completion function uses the undo system.
2016-12-07 17:02:25 +01:00
Sumedh Pendurkar
dca4ab5d8f
new feature: complete a fragment to a longer word found in the buffer
...
Executing the 'complete_a_word' function will search from the start
of the current buffer for entire words that begin with the fragment
that is before the cursor, and will complete this fragment to the
first word that is found. Each consecutive call of 'complete_a_word'
will search for the next matching word and will complete the fragment
to that. By default the function is bound to the ^] keystroke.
Signed-off-by: Sumedh Pendurkar <sumedh.pendurkar@gmail.com>
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-12-07 16:42:39 +01:00
Benno Schulenberg
33bc848c5b
binding: properly conditionalize the UTF-8 parts
...
Reported-by: Sumedh Pendurkar <sumedh.pendurkar@gmail.com>
2016-10-29 10:19:28 +02:00
Faissal Bensefia
de95ca68f7
new feature: the ability to show line numbers before the text
...
It can be activated with --linenumbers on the command line or with
'set linenumbers' in a nanorc file, and it can be toggled with M-#.
Signed-off-by: Faissal Bensefia <faissaloo@gmail.com>
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-10-20 16:47:52 +02:00
Benno Schulenberg
55878efe5d
binding: supply the keycode for most special keys directly
...
Instead of figuring them out from the string. This is possible
because those dedicated editing keys cannot be rebound anyway.
2016-10-18 20:38:27 +02:00
Benno Schulenberg
c92982d60f
binding: fix some duplicated carets and too restrictive menus
2016-10-15 17:18:51 +02:00
Benno Schulenberg
7a274d621a
binding: use arrows instead of words to designate the cursor keys
2016-10-15 17:04:01 +02:00
Benno Schulenberg
fdee0df849
input: keep the Ctrl+Arrow keys working when their synonyms are unbound
...
This fixes https://savannah.gnu.org/bugs/?49058 reported by Rishabh Dave.
2016-10-15 17:03:10 +02:00
Benno Schulenberg
3264d0c5be
tweaks: move a variable that doesn't need to be global
2016-10-12 19:59:26 +02:00
Benno Schulenberg
bc8bb7e942
screen: keep the help items nicely lined up also in the tiny version
2016-09-13 09:29:44 +02:00
Benno Schulenberg
08cd197bf1
general: include word-jumping and block-jumping into the tiny version
...
And also case-sensitive searches, backward searches, and searching again.
2016-09-13 09:27:04 +02:00
Benno Schulenberg
ed9e5d7183
docs: mark some rebindable function names as deprecated
2016-09-03 20:12:29 +02:00
Benno Schulenberg
fd6308d6d3
tweaks: reshuffle a couple of items
2016-09-03 13:42:19 +02:00
Benno Schulenberg
1dbebbcadc
screen: keep the help items aligned in more configurations
...
This fixes https://savannah.gnu.org/bugs/?48987 .
2016-09-03 13:35:19 +02:00
Benno Schulenberg
57d1755d10
tweaks: preen some comments, and reshuffle a few ifdefs
2016-09-03 12:14:08 +02:00
Benno Schulenberg
bace664fbc
startup: allow to rebind the RegExp toggle also in the tiny version
...
This fixes https://savannah.gnu.org/bugs/?48988 .
2016-09-03 11:45:49 +02:00
Benno Schulenberg
7b7d2bf7c9
tweaks: make tiny nano a teeny bit smaller
2016-09-02 12:01:03 +02:00
Benno Schulenberg
514cd9a099
update the license text to the preferred version
...
Mentioning "GNU nano" instead of "This program" and referring to the
website instead of to a postal address.
2016-08-29 21:27:16 +02:00
Benno Schulenberg
406e5242a3
update the copyright notices
2016-08-29 21:27:05 +02:00
Benno Schulenberg
382c9d792d
new feature: allow text selection by holding Shift with the cursor keys
...
Add the keycodes and routines to allow the user to forego setting the
mark explicitly (with M-A / ^6) and instead quickly select a few words
or lines by holding down Shift together with the movement keys.
(Some combinations with Shift are swallowed by some terminal emulators.
To work around some of those, the combinations Shift+Alt+Left/Right work
as Shift+Home/End and Shift+Alt+Up/Down work as Shift+PageUp/PageDown.)
2016-08-28 11:29:28 +02:00
Benno Schulenberg
aeb49a8013
bottombar: only count help items that have a shortcut bound to them
...
This avoids showing a ghost item in, for example, the WriteOut menu
when not using --tempfile and the user does not bind 'discardbuffer'.
2016-08-27 12:22:59 +02:00
Benno Schulenberg
c661506681
tweaks: use a separate function to ask ncurses for keycodes
2016-08-16 12:01:59 +02:00
Benno Schulenberg
928a24c204
input: look at the modifier keys only when compiled on Linux
...
This fixes https://savannah.gnu.org/bugs/?48751 reported by Andrew Ho.
This also fixes compilation when configured with --enable-tiny.
2016-08-14 21:42:08 +02:00
Benno Schulenberg
290d278f68
input: make the Ctrl+Arrow keys work on a Linux console
...
If this breaks your build, please send report or instructions or patch.
2016-08-07 18:20:34 +02:00
Rishabh Dave
1fd2354ad4
shortcuts: zero the value of 'toggle' for keys that are not toggles
...
This fixes http://savannah.gnu.org/bugs/?48698 .
Signed-off-by: Rishabh Dave <rishabhddave@gmail.com>
2016-08-07 11:31:55 +02:00
Benno Schulenberg
90a90365a8
tweaks: rename three constants, for clarity, and hardcode two others
2016-08-01 12:56:05 +02:00
Benno Schulenberg
cb10b2b908
tweaks: elide the global variable 'func_key'
...
There is no need to specially flag a function key or editing key --
the keycode is indication enough in itself: outside of byte range.
2016-07-31 18:13:05 +02:00
Benno Schulenberg
3930a697e8
tweaks: consistently use a parameter instead of a struct element
2016-07-30 13:05:52 +02:00
Benno Schulenberg
9322e1e6a4
tweaks: reshuffle two ifs for a little more speed
...
Saving roughly twenty microseconds at startup.
2016-07-30 13:04:06 +02:00
Benno Schulenberg
b70fe38eab
tweaks: normalize some indentation
2016-07-30 12:24:35 +02:00
Benno Schulenberg
1c528db8da
tweaks: condense three asserts into a single one
...
Also, when a key string does not denote a Ctrl nor Meta nor Function key,
there is no point in assigning a keycode, because plain characters cannot
be used as a function shortcut.
2016-07-30 12:24:35 +02:00
Benno Schulenberg
1c9ab8bf16
tweaks: rename a struct element, to be more fitting
...
The keycode is not a sequence; it is a single integer value.
2016-07-30 12:24:35 +02:00
Benno Schulenberg
e295070193
shortcuts: group the setting of key string and keycode into one function
...
And instead of using two key types, just use a bool to indicate whether
a keystroke involves Meta.
2016-07-30 12:21:42 +02:00
Benno Schulenberg
5b0ab8be62
shortcuts: remove any unnecessary classifying of keys
...
After initialization, the type of a key is never used nor needed
(other than for meta keys).
2016-07-30 12:13:47 +02:00
Benno Schulenberg
c6dbcf91c3
new feature: functions to jump to previous or following block of text
...
And hard-bind the keys Ctrl+Up and Ctrl+Down to these functions.
Unlike the paragraph-jumping code, these new functions disregard
any indentation, treating only blank lines as separators. They
also do an automatic smart home when that option is set.
This fulfills https://savannah.gnu.org/bugs/?48291 .
2016-07-24 12:00:00 +02:00
Benno Schulenberg
6f12992cea
new feature: add the option --wordchars, to set extra word characters
...
This allows the user to specify which other characters, besides the
default alphanumeric ones, should be considered as part of a word, so
that word operations like Ctrl+Left and Ctrl+Right will pass them by.
Using this option overrides the option --wordbounds.
This fulfills https://savannah.gnu.org/bugs/?47283 .
2016-07-13 20:49:30 +02:00
Benno Schulenberg
960e848cc7
tweaks: elide a typedef, as it now has just one element
2016-07-12 09:35:48 +02:00
Benno Schulenberg
9106cc8ecc
main: let the main loop restore the main menu, if needed
...
Don't make it the responsibility of the executed functions to restore
the list of shortcuts of the edit window. Just detect whether another
menu was displayed, and if so, redisplay the main menu.
2016-06-21 11:03:38 +02:00
Mike Scalora
6a2032f5b0
new feature: comment/uncomment current line or selected lines
...
This allows for commenting or uncommenting a line or a bunch of lines
with a single keystroke (default binding: M-3). The characters used
for commenting/uncommenting are specified by the active syntax file.
Reviewed-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Mike Scalora <mike@scalora.org>
2016-05-25 22:29:50 +02:00
Benno Schulenberg
c8f530af93
statusbar: add a non-beeping message type that does not get overwritten
...
Error messages about lock files should not get overwritten by purely
informational messages, only by alerting ones.
This fixes https://savannah.gnu.org/bugs/?47963 .
2016-05-21 13:58:09 +02:00
Benno Schulenberg
eedec06cc4
tweaks: fix compilation when configured with --enable-tiny --enable-browser
2016-05-17 12:48:47 +02:00
Benno Schulenberg
cdcd365d34
tweaks: normalize some whitespace
2016-05-17 11:33:21 +02:00
Benno Schulenberg
2535f51e01
statusbar: prevent error messages from overwriting each other
...
If during startup there are multiple error messages, currently only the
last one remains and can be read. To improve on that, introduce a short
pause between error messages -- even if it's not enough to read them all,
at least the user will be aware that there are multiple ones.
This also causes a few error messages to beep that currently don't beep,
such as when a file is unwritable.
2016-05-16 18:03:07 +02:00
Benno Schulenberg
36df5ceef6
browser: make Ctrl+Left and Ctrl+Right jump to left and right column
2016-05-16 17:01:45 +02:00
Benno Schulenberg
3d82986725
help: add an extra blank line to the lists of searching shortcuts
...
To separate things that have little to do with each other.
2016-05-16 16:55:11 +02:00
Benno Schulenberg
71e452aef2
screen: improve the conditional placement of a help-line item
...
When compiled with --disable-justify, try to keep the vertical pairing
of related items.
2016-05-16 16:34:07 +02:00
Benno Schulenberg
338807a327
help: bring some air into the lists of shortcuts, giving the eye a hold
2016-05-05 13:27:07 +02:00
Benno Schulenberg
318ed6b105
scrolling: center the cursor when inserted stuff does not fit on screen
...
Since nano-2.4.1, reading in or pasting a large piece of text would put
the cursor on the bottom line, leaving only one line of the non-read or
non-pasted text visible. This is different from the centering behavior
of Pico, and somewhat disorienting, as you can't see "where you are" any
more in relation to the file as it was.
So now center the cursor whenever the read or pasted text is larger than
the screen, but don't center it when the text fits entirely on the screen.
(The latter avoids the effect of the screen jumping unnecessarily when
inserting just a few lines while the cursor is near the bottom.)
To achieve this behavior: default to focusing, and temporarily set it to
FALSE when the focusing effect is unwanted.
This fixes https://savannah.gnu.org/bugs/?47841 .
2016-05-04 10:13:36 +02:00
Benno Schulenberg
e21e954742
browser: add a binding for the refresh function
...
And make the function actually refresh the list. Useful for when files
have been added or deleted since opening the browser.
2016-05-02 12:00:56 +02:00
Benno Schulenberg
e2556274f7
browser: provide tab completion also outside of the working directory
...
Add a global variable, 'present_path', so that 'cwd_tab_completion()'
knows where the user is in the browser, so that it can try completions
against names in that directory instead of always against names in the
current working directory (where nano was invoked).
This fixes https://savannah.gnu.org/bugs/?47234 .
Signed-off-by: Rishabh Dave <rishabhddave@gmail.com>
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-05-02 12:00:18 +02:00
Benno Schulenberg
53f4a9f5a8
screen: rename 'edit_refresh_needed' to 'refresh_needed'
...
For a little contrast with the function edit_refresh() -- it's
annoying that when you search for the latter you get to see all
the settings of the flag too.
2016-04-25 21:14:18 +02:00
Benno Schulenberg
d92eb4fee3
all: eradicate SVN's $Id$ tags
2016-04-05 14:59:12 +02:00
Benno Schulenberg
51743233ed
Removing the 'last_replace' variable that is never used.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5768 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-28 19:14:33 +00:00
Benno Schulenberg
8a244c607a
Renaming three variables.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5709 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-04 20:22:27 +00:00
Benno Schulenberg
90f1ccf9ac
Eliding the now too tiny function free_list_item().
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5708 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-04 18:28:03 +00:00
Benno Schulenberg
c02c182bd7
Deleting a now-unused struct member.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5707 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-04 17:04:56 +00:00
Benno Schulenberg
a24aee417d
Renaming a struct member.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5697 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-29 09:17:03 +00:00
Benno Schulenberg
07441adb14
Renaming another struct element, because it refers not just
...
to file extensions, but also to header lines and magic strings.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5690 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-26 20:19:13 +00:00
Benno Schulenberg
3522751c6b
Renaming a struct element for aptness and contrast.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5689 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-26 20:09:29 +00:00
Benno Schulenberg
818a39cfb9
Condensing some code by factoring out a repetition.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5659 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-22 09:34:33 +00:00
Benno Schulenberg
f4f9954556
Eliding the function free_openfilestruct() as it is used only once.
...
(Note that openfile cannot be NULL here. And in case it is,
nano should crash because DEBUG is enabled.)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5658 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-22 09:02:58 +00:00
Benno Schulenberg
814a4220a2
Removing four unneeded checks for NULL.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5657 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-21 20:54:04 +00:00
Benno Schulenberg
cca22bb10a
Guiding the translators a little bit.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5607 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-05 12:27:54 +00:00
Benno Schulenberg
5a5144b75a
Putting four strings in the standard order: first backward, then forward.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5606 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-05 12:01:02 +00:00
Benno Schulenberg
fe3d849a75
Getting rid of a global variable.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5574 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-20 15:56:40 +00:00
Benno Schulenberg
8bd76d8302
Verifying that the containing directory of the given filename exists.
...
Original patch by Rishabh Dave, edited by Benno.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5572 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-20 15:14:52 +00:00
Benno Schulenberg
a3a69eec02
Fixing a typo in an #ifndef symbol. Reported by Frank.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5569 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-17 16:25:31 +00:00
Benno Schulenberg
34fbb1f4de
Adjusting a few comments and rewrapping some lines.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5556 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-13 20:32:40 +00:00
Benno Schulenberg
deb271d708
Differentiating a variable name from function names.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5551 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-12 19:20:40 +00:00
Benno Schulenberg
1ac2c4cd4f
Adding a comment and using a symbolic value.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5537 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-07 15:42:44 +00:00
Benno Schulenberg
6d6cda24c8
Delete two unneeded #ifdefs -- better fail to compile than create a cripple.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5536 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-07 15:21:59 +00:00
Benno Schulenberg
9962e3b65c
Making "Tab" produce the appropriate keycode.
...
This fixes Savannah bug #46812 .
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5535 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-04 19:42:37 +00:00
Benno Schulenberg
22557df600
Adding "Tab" as a key description, just like "Del" and "Enter" already are.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5533 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-04 10:50:21 +00:00
Benno Schulenberg
dd29c56993
Rewriting the loop, and constifying the input of sctofunc().
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5530 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-04 09:52:43 +00:00
Benno Schulenberg
7a08fa63f5
No longer freeing any existing functions -- they are defined only once.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5529 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-04 09:44:35 +00:00
Benno Schulenberg
539a4b42be
Constifying the input parameter of strtosc() and strtomenu().
...
Patch by Mike Frysinger.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5528 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-04 09:12:21 +00:00
Benno Schulenberg
8cc6308f9c
Offering ^Q in the writeout menu to close and discard the current buffer
...
without saving it.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5509 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-12-23 16:34:44 +00:00
Benno Schulenberg
f08d79d204
Making Ctrl+Left and Ctrl+Right work on more terminals by asking
...
ncurses for the keycodes. This addresses Debian bug #800681 .
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5434 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-11-23 08:52:23 +00:00
Benno Schulenberg
bde996db67
Discarding a now useless function.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5403 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-11-11 19:56:35 +00:00
Benno Schulenberg
4a23a171b8
Allowing to exit the file browser with the same key as it was entered: ^T.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5396 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-11-08 19:40:13 +00:00
Benno Schulenberg
53fbcf77f2
Not checking whether a function has a help line; it's irrelevant.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5392 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-11-06 20:25:05 +00:00
Benno Schulenberg
f811846dc5
Allowing to change the file format in restricted mode, but actually disabling
...
Appending, Prepending, making Backups, and opening the File Browser.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5357 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-08-13 19:29:55 +00:00
Benno Schulenberg
90798fbfba
Allowing to toggle whitespace display also when support for nanorc files
...
has not been built in, since the default values are quite usable.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5348 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-08-09 16:05:50 +00:00
Benno Schulenberg
b3e4051ded
Adding two new bindable functions which delete all characters
...
from the cursor to the preceding or succeeding word start.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5334 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-07-31 11:52:26 +00:00
Benno Schulenberg
b7f7df93df
Changing "Justify" to a tag and regrouping a couple.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5332 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-07-30 19:51:08 +00:00
Benno Schulenberg
104ea6b0c3
Normalizing whitespace after the preceding changes.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5330 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-07-30 11:29:45 +00:00
Benno Schulenberg
2ee18d635f
Not showing ^R and ^T in the help lines in restricted mode (if possible),
...
to give visual feedback.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5329 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-07-30 10:37:28 +00:00
Benno Schulenberg
f7e8861770
Tweaking a string, to match the --help text.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5321 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-07-26 09:29:42 +00:00
Benno Schulenberg
4990f74f83
Adding two new bindable functions that repeat the last search command
...
in a fixed direction without prompting.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5320 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-07-26 09:23:24 +00:00
Benno Schulenberg
ee7b095678
Adding a new bindable function that writes a file to disk without
...
first asking for its name. Patch was suggested by Seiya Nuta.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5318 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-07-25 19:25:50 +00:00
Benno Schulenberg
474b390816
Plugging a few memory leaks.
...
Patch by Mike Frysinger.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5314 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-07-22 18:02:36 +00:00
Benno Schulenberg
1f866c29db
Renaming the 'menu' item to 'menus' in the shortcut struct.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5301 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-07-15 20:13:05 +00:00
Benno Schulenberg
5ac6a87522
Giving each toggle a sequence number, to be able to show them in a fixed order.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5282 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-07-06 17:51:17 +00:00
Benno Schulenberg
954f98c448
Removing a duplicate binding of ^T, to prevent it being shown twice.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5272 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-06-27 15:58:20 +00:00
Benno Schulenberg
c32a58a826
Not checking for non-NULL before freeing a variable, as it's unnecessary.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5249 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-06-14 19:14:41 +00:00
Benno Schulenberg
75d64e677e
Handling a SIGWINCH (which signals a change in window size) not when it
...
happens but only when checking for keyboard input. It now reports the
SIGWINCH via a special key value to the calling routine, to allow not
only the main editor but also the help viewer and the file browser to
adapt their display to the new size.
Patch by Mahyar Abbaspour, somewhat edited by Benno.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5228 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-05-28 13:02:29 +00:00
Benno Schulenberg
1cf22d4d4f
Initializing the search and replace strings in a central place.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5212 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-04-21 18:42:11 +00:00
Benno Schulenberg
296152ec67
Making the descriptions of the multibuffer feature more accurate.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5205 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-04-18 16:07:53 +00:00
Benno Schulenberg
cc65a42035
Arranging the movement keys in the File Browser in the order of
...
ascending stride, as in the Help Viewer.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5202 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-04-17 10:06:03 +00:00
Benno Schulenberg
5b83d7df51
Binding the unbound Home and End keys to goto_top and goto_bottom in the
...
Help Viewer and the File Browswer, to mimic the behaviour of these keys
in file viewers and web browsers.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5201 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-04-17 09:42:04 +00:00
Benno Schulenberg
4e9b3687ba
Rebinding ^Y and ^V in the WhereisFile menu
...
to the effective and consistent first_file() and last_file().
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5191 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-04-12 08:44:37 +00:00
Benno Schulenberg
07e199ff0e
When searching, put a found off-screen string on the center line
...
instead of at the bottom or top, to show it in context.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5170 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-03-28 17:01:46 +00:00
Benno Schulenberg
14a9c8aa0b
Treating the formatter like a speller,
...
to fix compilation with --disable-speller.
This fixes Savannah bug #44607 .
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5168 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-03-27 16:55:49 +00:00
Benno Schulenberg
52d7d5f55a
The linter is only available when colour is.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5167 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-03-27 15:34:41 +00:00
Benno Schulenberg
0b6d6f45d2
Normalizing some whitespace.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5166 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-03-27 13:46:50 +00:00
Benno Schulenberg
b455fa3a16
Allowing to rebind the linter when nano was configured with --disable-speller.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5162 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-03-25 19:33:00 +00:00
Benno Schulenberg
eae9f282de
Removing a mistaken menu name -- as the formatter allows no interaction
...
it needs no associated menu.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5160 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-03-25 16:20:45 +00:00
Benno Schulenberg
138add24c8
Keeping related items together in the ^G help screen.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5143 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-03-20 12:22:49 +00:00
Chris Allegretta
4b3f2771b5
2015-01-03 Chris Allegretta <chrisa@asty.org>
...
* New formatter code to support syntaxes like
go which have tools to automatically lint and reformat the text for
you (gofmt), which is lovely. rcfile option formatter, function
text.c:do_formatter() and some other calls.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5100 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-01-03 07:24:17 +00:00
Benno Schulenberg
dbb5e7cd8e
Moving first_sc_for() next to its sister function too.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5081 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-27 19:23:41 +00:00
Benno Schulenberg
80750632d0
Moving strtokeytype() next to its sister function.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5080 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-27 19:18:00 +00:00
Benno Schulenberg
d23283e249
Removing the now unused and unneeded addition ability to the shortcut list.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5079 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-27 19:13:46 +00:00
Benno Schulenberg
3933a30c9e
Adding a typedef for a pointer to a function: functionptrtype.
...
And starting to use this to make the code a bit cleaner.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5050 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-02 08:47:09 +00:00
Benno Schulenberg
e6a4a64619
Adding two defines to make the functions list clearer.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5049 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-01 18:52:21 +00:00
Benno Schulenberg
b095725429
Now delete these case-sensitive, regular-expressive and backwards
...
file-searching capabilities again and all provisions for them.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5048 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-01 16:24:01 +00:00
Benno Schulenberg
4947ad83cb
Showing that it is possible to have case-sensitive, regular-expressive,
...
and backwards searching in the file browser.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5047 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-01 15:42:08 +00:00
Benno Schulenberg
95e77a9d5f
Renaming '*cut_till_end' to '*cut_till_eof', to reduce
...
confusion with CUT_TO_END, which is about end-of-line.
Patch by Mark Majeres.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5041 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-30 20:39:27 +00:00
Benno Schulenberg
776931a0b0
Fixing a bug where binding a movement function to a Meta key would make
...
the corresponding Arrow key stop working (producing a character instead).
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5040 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-30 18:20:32 +00:00
Benno Schulenberg
7e5324d164
Making 'meta_key' and 'func_key' into global variables, instead of
...
having them declared everywhere and passing them around endlessly.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5039 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-30 18:04:33 +00:00
Benno Schulenberg
d48d84a3ba
Now trimming the superfluous braces.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5032 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-28 15:34:10 +00:00
Benno Schulenberg
b71cf98ec7
Using a single assignment of do_toggle_void.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5031 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-28 15:22:41 +00:00
Benno Schulenberg
0a1e56ed3c
Moving (the recognition of) the toggles to the end, like everywhere else.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5030 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-28 15:00:29 +00:00
Benno Schulenberg
d4623f3ca3
Eradicating the execute flag -- it is almost always TRUE, and when it's FALSE
...
then it's for a function that is an empty placeholder, so executing it will
not do anything anyway. Handling the one exception (do_gotolinecolumn_void)
specially, just like the other one (do_cancel) already is.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5029 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-28 14:42:18 +00:00
Benno Schulenberg
a8c13d79fe
Adding default keybindings for Cut, PrevWord and NextWord in the prompt input lines.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5021 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-27 15:51:24 +00:00
Benno Schulenberg
ef16223661
Adding the bindable function 'gotodir', documenting it, and also
...
documenting 'tofiles' and 'flipnewbuffer', and correcting the
description of 'gototext' (not being about the file browser).
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5015 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-23 20:03:25 +00:00
Benno Schulenberg
a0f66c0691
Renaming 'no_replace_void()' to 'flip_replace_void()',
...
to show what it actually does.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5014 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-23 18:30:35 +00:00
Benno Schulenberg
cf8a296279
Fixing compilation with --enable-tiny --enable-histories --enable-nanorc.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4998 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-20 16:03:38 +00:00
Benno Schulenberg
492e9f605b
Miscellaneous whitespace adjustments and comment tweaks.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4995 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-20 10:48:26 +00:00
Benno Schulenberg
4147c5e0fc
Removing two obsolete variables and regrouping some stuff.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4992 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-20 07:55:24 +00:00
Benno Schulenberg
3f816eeb58
Huh!? Why doesn't the build fail here without this change?
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4991 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-19 21:01:39 +00:00
Benno Schulenberg
ae2d300375
Pfff... Getting all iterations right is difficult.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4990 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-19 20:19:22 +00:00
Benno Schulenberg
b341f29cbd
Transform many DISABLE_NANORC #ifdefs to the new DISABLE_HISTORIES.
...
This completes the fix for Savannah bug #42539 .
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4989 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-19 20:05:24 +00:00
Benno Schulenberg
336d1b8902
Renaming 'function_type' to 'key_type', for clarity.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4983 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-18 20:43:05 +00:00
Benno Schulenberg
736fbf2e3f
Removing the --undo option, having the undo functions always enabled.
...
If wished, the user can unbind them. This fixes Savannah bug #42456 .
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4964 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-13 15:20:26 +00:00
Benno Schulenberg
6af5bdea27
A few more cosmetic tweaks and type fixes.
...
Patch by David Lawrence Ramsey.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4952 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-09 20:41:15 +00:00
Benno Schulenberg
505125e259
A few cosmetic tweaks of comments and whitespace.
...
Patch by David Lawrence Ramsey.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4948 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-09 14:23:53 +00:00
Benno Schulenberg
04a38da312
Allowing the toggle between Read File and Execute Command to be rebound.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4941 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-04 19:15:16 +00:00
Benno Schulenberg
1eb23d4988
Making use of the macros charalloc() and charealloc(), making use of
...
null_at(), adding a cast, and using an unsigned type for a length.
Patch by David Lawrence Ramsey.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4939 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-04 16:30:11 +00:00
Benno Schulenberg
1de337de9c
Normalizing whitespace, comments and interpunction, in various places.
...
Patch by David Lawrence Ramsey.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4938 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-04 16:02:51 +00:00
Benno Schulenberg
f470c900ae
Standardizing the calls of add_to_funcs(),
...
breaking always between menu and tag.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4928 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-28 21:02:39 +00:00
Benno Schulenberg
8c5f504c75
Making tiny nano again just a tiny bit tinier.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4927 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-28 20:31:06 +00:00
Benno Schulenberg
48223593de
Eliding four unneeded tags.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4925 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-28 19:02:00 +00:00
Benno Schulenberg
ff6b92cfdd
Making ^X in the Read-File menu toggle between
...
executing a command and inserting a file.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4922 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-28 15:35:00 +00:00
Benno Schulenberg
5a39339478
Allowing to rebind 'suspend' in tiny nano.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4915 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-27 12:38:32 +00:00
Benno Schulenberg
769e81c7c3
Make tiny nano a tiny bit tinier.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4914 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-27 12:34:43 +00:00
Benno Schulenberg
0d5e732793
Improving the arrangement of help items under certain compilation conditions.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4913 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-27 12:17:49 +00:00
Benno Schulenberg
022d32a647
Unwrapping some lines, and reordering two.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4912 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-26 10:07:00 +00:00
Benno Schulenberg
353dd21588
Cutting down on the size of tiny nano.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4909 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-25 19:47:46 +00:00
Benno Schulenberg
275bd28d3e
Tweaking some whitespace, using TRUE and FALSE instead of 1 and 0,
...
and mentioning the name of the terminal-tickling character (NBSP).
Patch by David Lawrence Ramsey.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4894 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-16 10:34:05 +00:00
Benno Schulenberg
d1238c02d3
Improving compilation with --disable-browser.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4877 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-13 20:51:19 +00:00
Benno Schulenberg
745410336b
Condensing a function a bit.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4875 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-13 20:20:51 +00:00
Benno Schulenberg
71c9a5245a
Several random whitespace and comment tweaks.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4874 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-13 20:14:01 +00:00
Benno Schulenberg
678b221c36
Weh -- use the correct type.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4873 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-13 18:31:13 +00:00
Benno Schulenberg
24bc59f5c2
Freeing the lists with functions and shortcuts upon exit.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4872 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-13 18:06:09 +00:00
Benno Schulenberg
1d5134d93e
Renaming the struct type 'exttype' to 'regexlisttype', and upon exit
...
also freeing the regexes for libmagic results and headerlines.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4862 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-12 14:31:54 +00:00
Benno Schulenberg
e7d6e55332
Making it possible for interface-foreground colours to be bright.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4853 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-10 19:15:04 +00:00
Benno Schulenberg
a6804b5f08
Putting softwrap back among the "Appearance" toggles.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4851 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-09 20:33:49 +00:00
Benno Schulenberg
387b20969d
Defining a shortcut for the linter when the speller is disabled,
...
and fixing compilation with --disable-speller.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4850 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-09 15:14:29 +00:00
Benno Schulenberg
d16f9af022
Not defining nor accepting shortcuts for functions that are disabled.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4849 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-09 12:20:20 +00:00
Benno Schulenberg
f8507bb9a1
Allowing the function do_cut_till_end() to be rebound.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4840 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-05 19:54:34 +00:00
Benno Schulenberg
abaaf2df1e
Oops.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4838 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-04 20:16:30 +00:00
Benno Schulenberg
0846583a2c
Allowing the Backwards toggle to be rebound,
...
documenting it, ánd the Backspace function.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4837 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-04 12:20:51 +00:00
Benno Schulenberg
c970035001
Renaming a variable, and removing an unneeded call of wattroff().
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4834 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-04 08:53:06 +00:00
Benno Schulenberg
be3e302a76
Paragraph jumping only makes sense in the MAIN editing menu,
...
thus removing the shortcuts from all others.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4831 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-03 20:27:25 +00:00
Benno Schulenberg
672821cb68
Removing the search-mode toggles from the WHEREISFILE and
...
REPLACEWITH menus, where they don't belong.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4830 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-03 20:09:47 +00:00
Benno Schulenberg
523598a342
Ordering the shortcut associations in roughly the same manner as
...
in the help lines, and grouping them as far as possible per menu.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4829 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-03 19:19:31 +00:00
Benno Schulenberg
436cd349b4
Unfolding long lines that add shortcuts, for visual consistency.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4828 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-03 18:44:18 +00:00
Benno Schulenberg
1663994e42
Adding the ability to colour four elements of nano's interface differently.
...
Idea and original patch by Mark Majeres.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4827 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-03 18:24:45 +00:00
Benno Schulenberg
7a9f4a456e
Update the years in the copyright notices.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4826 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-30 20:18:26 +00:00
Benno Schulenberg
6371612508
Improving the order of the help items still further, and
...
making them also group and pair nicely in the tiny version.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4825 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-27 19:51:03 +00:00
Benno Schulenberg
5f655da048
Fixing compilation with --enable-tiny.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4824 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-27 15:26:25 +00:00
Benno Schulenberg
4da2434dd7
Improving order and grouping in the main help text and help lines.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4823 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-27 15:20:57 +00:00
Benno Schulenberg
61758e95ea
Show the important toggles early on in the help lines
...
of Search/Replace, and group them better.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4822 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-27 14:21:57 +00:00
Benno Schulenberg
618051cac7
Group related functions together, remove duplicate "up"/"down",
...
and add missing "prevpage"/"nextpage" in nanorc man page.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4818 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-26 20:16:17 +00:00
Benno Schulenberg
301c4ef6b3
Allow do_spell() to be bound to other key combos.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4817 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-26 19:33:11 +00:00
Benno Schulenberg
11d76449d2
Make help lines show "Close" again when more than one buffer is open.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4816 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-26 19:01:18 +00:00
Benno Schulenberg
20b1e92857
Add a pointer to the tail of the functions list,
...
to simplify and speed up adding new items.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4815 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-26 18:41:43 +00:00
Benno Schulenberg
9df767288c
Putting the two wrapping toggles together
...
and increasing their contrast a bit.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4812 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-23 20:37:32 +00:00
Benno Schulenberg
86b8686010
Returning the first shortcut that matches a given func in a given menu.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4811 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-23 20:03:24 +00:00
Benno Schulenberg
9c0f9de7c5
Listing function key after meta key.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4806 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-22 19:10:26 +00:00
Benno Schulenberg
47be8c2fd8
Putting left/right in normal order.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4805 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-22 19:07:32 +00:00
Benno Schulenberg
c40cf0ad90
Deleting unneeded empty funcs; being in the list of shortcuts is enough.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4804 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-22 12:10:30 +00:00
Benno Schulenberg
c8b60cec00
Eliding more unneeded constants.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4803 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-22 11:57:11 +00:00
Benno Schulenberg
9aebd27d19
Eliding several pointless constants.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4802 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-22 10:44:24 +00:00
Benno Schulenberg
9fc713b4f1
Renaming many constants from '*_msg' to '*_tag' to reduce confusion.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4801 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-22 10:18:48 +00:00
Benno Schulenberg
12da94c9b2
Putting the movement keys in the help viewer in the order of increasing stride.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4800 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-22 10:02:55 +00:00
Benno Schulenberg
94b1d01bb4
Allowing the codes from Ins and Del keys to be rebound.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4798 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-21 18:05:11 +00:00
Benno Schulenberg
d630880802
Giving nicer names to the dedicated keys,
...
for when they show up in the help lines.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4796 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-21 15:45:23 +00:00
Benno Schulenberg
75ff3a9587
Decombining a repetitive condition.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4795 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-21 15:22:14 +00:00
Benno Schulenberg
3064db26e6
Sorting functions slightly better, and
...
allowing rebinding in the linter menu.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4791 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-21 12:06:20 +00:00
Benno Schulenberg
57d773f8d0
No unnecessary checking for lowercase 'm' or 'f'.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4790 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-21 11:22:54 +00:00
Benno Schulenberg
bb8c9031a4
Putting meta first, for clarity.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4789 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-21 11:15:48 +00:00
Benno Schulenberg
e0149c1d9a
Adjusting two comments.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4788 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-21 11:09:30 +00:00
Benno Schulenberg
f6a3ab0cd0
Making better use of MMOST.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4786 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-16 09:55:16 +00:00
Benno Schulenberg
e167afe14d
Renaming MREPLACE2 to MREPLACEWITH, for clarity.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4784 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-16 09:26:15 +00:00
Benno Schulenberg
4c9573dd91
Renaming MALL to MMOST, for accuracy.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4783 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-16 09:12:13 +00:00
Benno Schulenberg
5c2b44a48a
Adding shortcut ^L for Refresh to the help viewer,
...
to be able to position ^X Exit as the very first.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4780 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-15 20:01:19 +00:00
Benno Schulenberg
fdec2a1d2d
Adding M-\ and M-/ for First and Last Line to the help viewer.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4778 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-15 19:28:11 +00:00
Benno Schulenberg
5bd359dbb9
Normalizing whitespace around '==' comparison.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4776 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-15 15:02:43 +00:00
Benno Schulenberg
eea0908236
Converting #ifdef ENABLE_NANORC to #ifndef DISABLE_NANORC.
...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4765 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-13 20:50:20 +00:00