Commit Graph

8208 Commits (53d4224be9a73916eec82fd13e3fe60fef3555a0)

Author SHA1 Message Date
Benno Schulenberg 4d44b03fc8 tweaks: rename a variable, to be more compact 2019-09-22 17:38:22 +02:00
Benno Schulenberg 2d16c27820 tweaks: add two hints for translators, to try and help avoid mistakes 2019-09-22 17:31:27 +02:00
Benno Schulenberg ad65b79ac7 usage: mark the -J/--guidestripe option plus argument as translatable
This fixes https://savannah.gnu.org/bugs/?56930.

Bug existed since the vertical guiding bar was introduced,
in version 4.0, commit 66c6eb51.
2019-09-21 19:50:55 +02:00
Benno Schulenberg fe5bd8cdef usage: properly align --help output also when it has accented characters
As printf() is not UTF8-aware, we have to determine ourselves how many
columns each short and long flag take up and add the required number of
spaces (not tabs, because their size is not fixed) to fill things up.

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

Bug existed since version 4.3, commit 2f169107.
2019-09-21 19:31:48 +02:00
Benno Schulenberg c848ec3d53 tweaks: elide two multiplications with something that is always 1 2019-09-18 15:25:42 +02:00
Benno Schulenberg ab6390cad0 tweaks: remove two superfluous macros, as sizeof(char) is always 1 2019-09-18 15:20:08 +02:00
Benno Schulenberg 48124fdba4 tweaks: use a more effecient way to skip storing an empty file name
Position history refers only to actual files, so when the filename
is blank...  there is nothing that needs to be remembered.
2019-09-18 14:18:48 +02:00
Benno Schulenberg ebd9eb346d tweaks: improve a bunch of comments, and reshuffle some declarations 2019-09-17 17:38:42 +02:00
Benno Schulenberg 413116e1b5 tweaks: rename another variable, for a better fit 2019-09-17 16:46:11 +02:00
Benno Schulenberg 69a3d39bc4 tweaks: rename three variables, for more contrast 2019-09-17 16:42:53 +02:00
Benno Schulenberg f081fa3047 tweaks: rename two variables, to better describe what they contain
The 'tilded' variable is used for two purposes: a user's home directory,
and an intermediate user name.
2019-09-17 14:26:09 +02:00
Benno Schulenberg 4383b01b9b tweaks: adjust indentation after previous change, reshuffle declarations 2019-09-17 14:11:45 +02:00
Benno Schulenberg b901a20a06 tweaks: use an early return when there is no tilde
Also improve a comment, and use a 'while' instead of a 'for'.
2019-09-17 14:09:40 +02:00
Benno Schulenberg d6e05d8376 tweaks: simplify the determination of a canonical path
Suggested-by: Brand Huntsman <alpha@qzx.com>
2019-09-17 13:32:15 +02:00
Benno Schulenberg 21e307e820 tweaks: rename a variable, normalize a comment, and reshuffle a free() 2019-09-16 17:25:47 +02:00
Benno Schulenberg dbcf4f0cbe color: don't concatenate an absolute path with the working directory
When the user specified an absolute path... it is NOT relative to the
current working directory.

This fixes https://savannah.gnu.org/bugs/?56902.
Reported-by: Brand Huntsman <alpha@qzx.com>

Bug existed since version 2.4.2, commit ec8d51be.
2019-09-16 17:12:25 +02:00
Benno Schulenberg 7b88557ef5 tweaks: meld two calls of free() into a single one, to elide an 'else' 2019-09-16 16:55:03 +02:00
Benno Schulenberg 75a6abe6d2 docs: mark the undoing of justifications as done in the TODO list 2019-09-11 17:25:35 +02:00
Benno Schulenberg ba5b85baf0 tweaks: rename three variables, to better indicate what they hold
They hold not a terminal but flags, settings, state.
2019-09-06 19:40:38 +02:00
Benno Schulenberg 9f95fa9ce5 tweaks: reshuffle a line, to group things better 2019-09-06 19:25:43 +02:00
Brand Huntsman 8853bc448d search: accept a match at start of file when searching from command line
For a forward search from the command line, pass FALSE to 'skipone'
so that an occurrence at the head of the file is not skipped over.

This fixes https://savannah.gnu.org/bugs/?56845.
Reported-by: Derek Wolfe <dwwolfe1@gmail.com>

Signed-off-by: Brand Huntsman <alpha@qzx.com>
2019-09-02 09:05:50 +02:00
Benno Schulenberg 15148a5e6d search: after search-at-startup, store the column (for vertical movement)
This fixes https://savannah.gnu.org/bugs/?56846.
2019-09-01 16:15:15 +02:00
Benno Schulenberg 7d9ad31cd9 po: update translations and regenerate POT file and PO files 2019-08-25 10:57:32 +02:00
Benno Schulenberg aecbc6faa9 bump version numbers and add a news item for the 4.4 release 2019-08-25 10:29:14 +02:00
Benno Schulenberg a06b921f12 docs: document the search-at-startup feature (+/string or +?string) 2019-08-20 19:22:25 +02:00
Benno Schulenberg bdf1a9d4e7 syntax: perl: avoid upsetting older glibcs with crafty range expression
The regcomp() function from glibc-2.27 (and older) considers the
bracket expression ['-.] to be invalid -- mistakenly.  Avoid using
any range expression in the relevant regex and instead enumerate
all acceptable characters.

This avoids https://savannah.gnu.org/bugs/?56766.
2019-08-19 17:15:29 +02:00
Benno Schulenberg 5c399dfc6e build: exclude the search-at-startup feature from the tiny version 2019-08-18 13:03:11 +02:00
Benno Schulenberg ed4b6486a1 search: don't wipe the status bar at startup when there was an error 2019-08-18 12:59:23 +02:00
Brand Huntsman 2326bf695e search: accept toggles for case and regex when searching at startup
Allow the user to specify that the search string should be interpreted
case-sensitively and/or as a regular expression by preceding the search
indicator (/ or ?) with c and/or r.  Or to switch these things off by
using C and/or R.

Signed-off-by: Brand Huntsman <alpha@qzx.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2019-08-18 12:59:04 +02:00
Benno Schulenberg a9dd73fb16 new feature: allow specifying a search string to "jump to" at startup
The string to "jump to" is specified with +/ for a forward search
(from the top of the file), or with +? for a backward search (from
the bottom of the file).

This fulfills https://savannah.gnu.org/bugs/?54535.
Requested-by: Derek Wolfe <dwwolfe1@gmail.com>

With-help-from: Brand Huntsman <alpha@qzx.com>
2019-08-18 11:16:03 +02:00
Benno Schulenberg 073bd3ad6e rcfile: properly handle an empty syntax before an 'include' statement
So that in the error message the correct filename gets shown
instead of the name of the (first) include file.

Reported-by: Brand Huntsman <alpha@qzx.com>
2019-08-18 10:56:17 +02:00
Benno Schulenberg 4bcc224560 docs: change a few URLs over to https, and rewrap a couple of NEWS items 2019-08-17 17:17:32 +02:00
Benno Schulenberg f2f367ba9c syntaxes: change some unneeded 'icolor' commands to 'color' commands 2019-08-17 17:01:19 +02:00
Benno Schulenberg 48bff32ee3 gnulib: update to its current upstream state 2019-08-17 15:35:43 +02:00
Brand Huntsman 304f07258b rcfile: for an empty syntax, show the line number of the 'syntax' command
When reporting a syntax without any color commands, show the line number
of the relevant 'syntax' command instead of the line number where the
emptiness is concluded, because the latter can be many lines later.

Signed-off-by: Brand Huntsman <alpha@qzx.com>
2019-08-17 13:47:19 +02:00
Benno Schulenberg e1c2573c7a tweaks: improve a comment, and drop a superfluous one 2019-08-17 13:28:47 +02:00
Benno Schulenberg 07ec7de8eb tweaks: remove a saving and restoring that has become superfluous
The previous commit saves and restores filename and linenumber for
each single included file (after globbing), so it is now redundant
to do it for each 'include' command.
2019-08-17 13:21:34 +02:00
Brand Huntsman 82f5fed45a rcfile: report the correct command location for an invalid 'include'
For each included file, save and restore file name and line number of
the including file, so that an error message about a faulty 'include'
command can indicate the location of this 'include'.

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

Signed-off-by: Brand Huntsman <alpha@qzx.com>
2019-08-17 13:07:20 +02:00
Benno Schulenberg a2f7e31ba2 new document: a condensed overview of nano's shortcut keystrokes
It's in a two-column format that fits on a single page, and uses the
more widely known Ctrl+X and Alt+X notations (instead of ^X and M-X).

The file is published on https://nano-editor.org/cheatsheet.html.
2019-08-16 19:49:50 +02:00
Benno Schulenberg 55983ee9d1 docs: make the synopsis of --speller and 'set speller' more accurate 2019-08-16 18:50:49 +02:00
Benno Schulenberg cd274a7830 syntax: perl: don't color the character after a variable name
And generally improve the regex for coloring Perl variable names.

This fixes https://savannah.gnu.org/bugs/?56713.
With-help-from: Brand Huntsman <alpha@qzx.com>

Bug existed since the Perl syntax was introduced,
in version 1.2.2, commit 70047eef.
2019-08-14 09:24:32 +02:00
Benno Schulenberg f773fa3968 syntax: default: colorize bracketed section headers in some config files 2019-08-14 09:18:51 +02:00
Benno Schulenberg 288355686b syntax: c: allow an underscore in lowercase type names 2019-08-11 20:06:46 +02:00
Benno Schulenberg f7d5a82a5d search: wipe the status bar before searching again (M-W / M-Q)
So that any message that is on the status bar after the search
will be a response to this search and not some leftover.

This fixes https://savannah.gnu.org/bugs/?56737.
2019-08-10 13:11:41 +02:00
Benno Schulenberg 63e04ac31e tweaks: make a function name unique, to not overlap with others 2019-08-09 19:34:03 +02:00
Benno Schulenberg 0c63b50fdc tweaks: move a general function to a better place 2019-08-09 19:24:30 +02:00
Benno Schulenberg 94c9defde1 docs: slightly reword some of the descriptions around syntax highlighting 2019-08-09 19:16:16 +02:00
Benno Schulenberg ee91c51e09 syntax: perl: avoid recognizing embedded hash signs as a comment starter
Require that a comment starts at the start of a line or is preceded by
whitespace.  This prevents most hash signs used for other purposes (and
what follows them) getting colored as comments.
2019-08-08 12:08:34 +02:00
Benno Schulenberg 1e3f3a7511 syntaxes: recognize .ctp extension as a PHP file, and .cu as a C/C++ file
This brings color to CakePHP template files, and to CUDA files.

This addresses https://bugs.debian.org/932192.
Requested-by: Jérôme Bardot <bardot.jerome@gmail.com>
2019-08-08 12:02:07 +02:00
Benno Schulenberg 8fce33afe0 text: copy leading quote characters when automatic hard-wrapping occurs
When the user is typing a long text and --breaklonglines is in effect,
then any leading comment or quoting characters are automatically added
to each automatic new line.

This fulfills https://savannah.gnu.org/bugs/?56042.
Requested-by: Sébastien Desreux <seb@h-k.fr>
2019-08-06 09:10:34 +02:00