Commit Graph

9023 Commits (009fb2fae65b35de99cb50a6ce79d767bb2d1ec9)

Author SHA1 Message Date
Benno Schulenberg 009fb2fae6 tweaks: make three hard-bindings of special keys more efficiently
Instead of calling a function that tries to find the relevant operation,
just add three hidden hard-bindings at the end of the shortcuts list.

They are hidden because we don't want them to show up in the help text,
because we don't know what to call them (as a Cancel and Suspend key
don't exist on normal keyboards) or naming the key would be confusing
(Sh-Ins is grabbed by the desktop manager and doesn't reach nano).
2020-06-27 10:20:45 +02:00
Benno Schulenberg 7fa6e95ce1 tweaks: avoid a function call when a simple boolean will do 2020-06-26 19:44:19 +02:00
Benno Schulenberg 8bce70e038 tweaks: rename a variable, to better describe what it holds 2020-06-26 19:27:28 +02:00
Benno Schulenberg b55153524a tweask: adjust the indentation after the previous change
Also improve a comment.
2020-06-26 19:18:05 +02:00
Benno Schulenberg a9ce488cc5 tweaks: drop a superfluous check for a non-zero length
The get_history_completion() function is called in just one place,
and gets called only when the length parameter is larger than zero.

Also, improve a few comments.
2020-06-26 19:07:47 +02:00
Benno Schulenberg 8061a981b1 tweaks: correct two spelling mistakes [codespell] 2020-06-26 11:27:07 +02:00
Benno Schulenberg e64c950896 tweaks: close opened files when something goes wrong [coverity] 2020-06-26 10:24:52 +02:00
Benno Schulenberg 69b12d907e tweaks: avoid unneeded calls of free() by reallocating the full name 2020-06-26 09:57:38 +02:00
Benno Schulenberg c0c4a1b2b5 tweaks: plug a leak, by always freeing the full filename [valgrind] 2020-06-26 09:47:38 +02:00
Benno Schulenberg 18659f3485 build: fix the Makefile after two header files were renamed
Reported-by: Kamil Dudka <kdudka@redhat.com>
2020-06-25 21:11:26 +02:00
Benno Schulenberg 94f49e208f tabbing: beep at the first listing, and when there are zero possibilities
A successful single completion is silent, but when there are zero
or multiple possibilities, nano beeps.
2020-06-25 10:26:01 +02:00
Benno Schulenberg 3f63982593 tweaks: rewrap a few lines in old news items, for more balanced lines 2020-06-25 10:09:13 +02:00
Benno Schulenberg 7f77cad1b4 tweaks: condense the code a little further, by grouping things better 2020-06-25 10:03:56 +02:00
Benno Schulenberg e7511abd86 tweaks: avoid checking a variable three times for each pass in the loop 2020-06-25 09:57:41 +02:00
Benno Schulenberg b1b89f01b7 docs: mention that M-X toggle is special, because available in most menus 2020-06-24 09:30:08 +02:00
Benno Schulenberg 24740815f6 files: make better use of the last row when there are many completions
Put the "(more)" not in the first column of the last row but in the
last column.
2020-06-23 08:28:47 +02:00
Benno Schulenberg c7356c2d85 files: show possible tab completions near the bottom of the edit window
Especially when it are just a handful of possible completions, it is
much nicer to have them listed close to the prompt bar where the eyes
of the user are.

This fulfills https://savannah.gnu.org/bugs/?58620.
2020-06-23 08:28:47 +02:00
Benno Schulenberg 91ba76e1e0 tweaks: normalize the indentation after the previous change
Also, improve five comments.
2020-06-23 08:28:47 +02:00
Benno Schulenberg 3dcabd6d03 tweaks: make an early return for zero matches, and rename a variable 2020-06-23 08:28:47 +02:00
Benno Schulenberg 0f843b007a tweaks: avoid an unnecessary refresh for zero or just one completion 2020-06-23 08:28:47 +02:00
Benno Schulenberg ff11ab6b66 files: list possible completions after just one <Tab> instead of two
This gives quicker feedback, and spares the user unnecessary beeps
and typing.  Also, now a beep after a <Tab> means just one thing:
there are NO completions.

This fulfills https://savannah.gnu.org/bugs/?58627.
2020-06-23 08:28:47 +02:00
Benno Schulenberg 096e36279f build: fix compilation for --enable-tiny --enable-color --enable-nanorc 2020-06-22 14:03:48 +02:00
Benno Schulenberg 5eb3b8feb5 tweaks: add a helpful message for when pkg.m4 is missing during a build 2020-06-22 14:03:32 +02:00
Benno Schulenberg f601eeda57 build: fix compilation when configured with --disable-color 2020-06-22 12:49:04 +02:00
Benno Schulenberg 2430c5b230 build: allow compilation to succeed on curses without italic support
The OpenBSD system that I have access to still uses ncurses-5.7,
and support for A_ITALIC appeared in version 6.0.
2020-06-22 11:19:05 +02:00
Benno Schulenberg 9b8930cc13 tweaks: adjust the conditional help-item pairing for absence of speller
The Spell Checker is no longer among the first twelve items of the
main menu, so the conditional placing of the Go To Line item should
no longer depend on it.
2020-06-22 09:09:05 +02:00
Benno Schulenberg 0f0b620c65 build: fix compilation when configured with --disable-speller
Move two functions that are used by the formatter too
to between the proper #ifdef.

Problem existed since commit 8089f5ad from a month ago.
2020-06-22 08:42:49 +02:00
Benno Schulenberg a7aab18dfe colors: move purple one step away from magenta, and use a darker mauve 2020-06-21 19:21:07 +02:00
Benno Schulenberg a9e171de52 tweaks: update three translator hints, add two, and frob three strings 2020-06-21 14:10:37 +02:00
Andreas K. Foerster ad2490c3fc syntax: ada: new file -- coloring rules for Ada 2012 files
Signed-off-by: Andreas K. Foerster <akf@akfoerster.de>
2020-06-21 09:33:14 +02:00
Benno Schulenberg 380589d95d tweaks: reshuffle and trim a comment, and remove unneeded pair of braces 2020-06-21 09:20:44 +02:00
Benno Schulenberg bb496bf456 tweaks: rename two variables, to be shorter and without abbreviations 2020-06-21 09:12:59 +02:00
Benno Schulenberg b086d0bad0 tweaks: elide another parameter, relevant in just three menus
The parameter was referenced in just one place.  So, simply check for
the three relevant menus (and unrestricted mode) and be done with it.

This also has the pleasant effect that the menu name is now the first
parameter of do_prompt(), thus clearly indicating what prompt it is,
instead of having an opaque TRUE or FALSE value at the beginning.
2020-06-20 17:19:23 +02:00
Benno Schulenberg a13b0bc854 files: disallow tabbing when in restricted mode
Tabbing can list all files in the given directory, but restricted mode
is supposed to prevent the user from any access to the filesystem...

This fixes https://savannah.gnu.org/bugs/?58632.

Bug existed (in this form) since version 1.3.4, commit f7b5d930.
2020-06-20 14:55:28 +02:00
Benno Schulenberg bbdbf4586f build: make ./configure report which global nanorc file will be used
This addresses https://savannah.gnu.org/bugs/?57061.
Requested-by: Robert Johnson <aloha@blastpuppy.com>
2020-06-20 14:02:34 +02:00
Benno Schulenberg af5010c96f syntax: default: colorize embedded control codes 2020-06-20 13:54:48 +02:00
Benno Schulenberg 90f6342fd1 tweaks: rename two header files, to be distinct and not an abbreviation 2020-06-20 12:09:31 +02:00
Pedro Victor de Brito Cordeiro 84b187f627 tweaks: make parameter names in prototypes match those in the definitions
Also, remove three prototypes of functions that no longer exist.

Signed-off-by: Pedro Victor de Brito Cordeiro <pedrocga1.opensource@gmail.com>
2020-06-20 11:25:09 +02:00
Benno Schulenberg 499b926b74 tweaks: elide a parameter that is relevant for only one menu (Goto Dir)
Instead of burdening seven other calls of do_prompt() with a useless
parameter, just check for MGOTODIR in the appropriate place.  It also
saves having to pass the parameter down through three more functions.
2020-06-19 10:55:28 +02:00
Benno Schulenberg 61dda8ff62 tweaks: rename a variable, to make more sense 2020-06-19 10:12:49 +02:00
Benno Schulenberg 6ce4e3ede8 feedback: do not list "." and ".." as possible <Tab><Tab> completions
The single dot serves no purpose, as the user is already there.  And
the double dot is reached more easily by typing a second dot first.

And anyway, . and .. are not shown when the user does not type a dot
first, so why show them when the user types a single dot followed by
<Tab><Tab>?  Most likely the user wants to see actual dot files, so
just show those.

This fixes https://savannah.gnu.org/bugs/?58619.
2020-06-19 10:06:33 +02:00
Benno Schulenberg 287718cf8b tweaks: rename two parameters, to be more fitting 2020-06-18 19:12:11 +02:00
Benno Schulenberg 78f54523d9 tweaks: elide a variable and be more direct, and rename another 2020-06-18 19:02:02 +02:00
Benno Schulenberg 9faa95450b tweaks: rename two functions, and rename and reshuffle a parameter
Also, drop an unneeded nulling: the function copy_of() already
NUL-terminates the copied string.
2020-06-18 17:24:18 +02:00
Benno Schulenberg 26d7a7494e tweaks: improve several comments, and rewrap two lines 2020-06-18 17:10:05 +02:00
Benno Schulenberg d8249917c3 bindings: allow toggling the help lines at several prompts and in browser
Now the help lines can be toggled not only while editing, but also at
the Read (^R), Write (^O), Execute (^T), Search (^W), Replace (M-R),
Goto (^/), and Yesno prompts, and also in the file browser and when
searching for a file name.  The help lines cannot be toggled in the
help viewer, nor when searching in a help text, nor in the linter,
as these three things force the help lines to be on.

Furthermore, the 'nohelp' function can be rebound in all relevant
menus (default binding: M-X).

This fulfills https://savannah.gnu.org/bugs/?58471.
2020-06-18 15:36:10 +02:00
Benno Schulenberg 054cafa138 docs: mention the nine new color names, and "bold" plus "italic" 2020-06-18 15:31:06 +02:00
Benno Schulenberg bafcc19b7a tweaks: rename a symbol, from a phrase to a noun 2020-06-18 15:31:06 +02:00
Benno Schulenberg 61c94c2f81 rcfile: report the first bad color element, not a later one that is okay
This fixes https://savannah.gnu.org/bugs/?58605.

Bug existed since commit c275c515 from several days ago.
2020-06-18 15:31:06 +02:00
Benno Schulenberg 69a90dd7af tweaks: elide two redundant calls of strchr() 2020-06-18 15:31:06 +02:00