Commit Graph

195 Commits

Author SHA1 Message Date
Benno Schulenberg c64f506933 tweaks: reshuffle some declarations, and expand a few variable names 2020-01-28 10:21:34 +01:00
Benno Schulenberg afa4c6b9fc copyright: update the years for the FSF 2020-01-15 11:42:38 +01:00
Benno Schulenberg 31d5cb1118 build: slightly speed up the compilation of the tiny version
Don't include header files when they won't actually be needed.

(Also, remove a superfluous #ifdef.)
2019-10-13 18:55:49 +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 1fcb9b99cf tweaks: move a function to before the first one that calls it 2019-06-23 12:29:17 +02:00
Benno Schulenberg d8c840692e tweaks: reshuffle an 'if' out of a function, and rename the function 2019-06-23 12:15:19 +02:00
Benno Schulenberg 8c7b6bd21a tweaks: when precalculating, allocate all the cache space upfront
Instead of doing it haphazardly while lines are getting categorized.
2019-06-23 11:57:27 +02:00
Benno Schulenberg 21d0755de5 tweaks: try the allocation of a multidata cache just once per line
It does not need to be allocated for each multiline regex separately.
2019-06-23 11:45:03 +02:00
Benno Schulenberg 967f581860 tweaks: adjust some whitespace and rewrap a few lines
And remove two unneeded casts.
2019-06-09 20:03:44 +02:00
Benno Schulenberg 1075de1222 tweaks: rename two functions, to get rid of the "mb" abbreviation
Also, for me "move" is about moving the cursor.  But these functions
are about moving an index in a text, which is more general.
2019-06-09 19:37:56 +02:00
Benno Schulenberg fb17929fab tweaks: use FALSE for booleans instead of zero
Also adjust some indentation and reduce the scope of a variable.
2019-06-09 10:41:14 +02:00
Brand Huntsman 57b3f83cfe rcfile: compile the color regexes just once
When a syntax gets parsed, store the compiled color regexes right away,
instead of compiling them a second time in color_update().

This addresses https://savannah.gnu.org/bugs/?56432.

Signed-off-by: Brand Huntsman <alpha@qzx.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2019-06-04 19:57:46 +02:00
Brand Huntsman fb10a94f35 startup: prevent a crash when no applicable syntax is found
This fixes https://savannah.gnu.org/bugs/?56434.

Signed-off-by: Brand Huntsman <alpha@qzx.com>
2019-06-04 12:42:24 +02:00
Brand Huntsman cba9d8d05e rcfile: fully parse a syntax file only when needed
When parsing an included syntax file, stop reading when a command other
than 'syntax', 'header' or 'magic' is encountered.  The syntax file is
fully parsed the first time that a file needs it.  Each 'extendsyntax'
command is stored for unloaded syntaxes and applied after the syntax
is loaded.

Closing a buffer does not unload the syntax, even if no longer used by
another buffer.

This addresses https://savannah.gnu.org/bugs/?54928.

Signed-off-by: Brand Huntsman <alpha@qzx.com>
2019-05-20 10:25:47 +02:00
Benno Schulenberg c55d144748 tweaks: drop most of the remaining debugging code, and some timing code 2019-05-08 15:23:36 +02:00
Benno Schulenberg cddfcb1b9d tweaks: rename a struct element, to make sense 2019-03-21 17:23:49 +01:00
Benno Schulenberg aac4fc46e9 tweaks: rename a type, to make more sense 2019-03-21 17:08:52 +01:00
Benno Schulenberg 916b4d81d0 rcfile: add 'stripecolor' for changing the color of the guiding stripe
The default is now simply reverse video, which works better than a
"loud" colored bar in an interface that for the rest is monochrome.
2019-03-09 09:27:08 +01:00
Benno Schulenberg 79ca3ceabf copyright: update the years for the FSF 2019-02-24 19:35:56 +01:00
Benno Schulenberg 798695ff1e utils: retire the fixbounds() function -- it is no longer needed
All tested systems (FreeBSD, NetBSD, OpenBSD, Alpine, and Ubuntu)
support the GNU-style word boundaries (\< and \>), either natively
or through using the regex module from gnulib.

If this change breaks regexes containing \< or \> on your system,
please report a bug: https://savannah.gnu.org/bugs/?group=nano

This addresses https://savannah.gnu.org/bugs/?55207.
2018-12-31 13:49:07 +01:00
Brand Huntsman b5ede4ff65 tweaks: remove the 'bright' field from the colortype struct
Put the corresponding value into the 'attributes' field sooner.

Signed-off-by: Brand Huntsman <alpha@qzx.com>
2018-08-25 10:54:20 +02:00
Benno Schulenberg 0b30835dd0 tweaks: use meaningful names instead of puzzling values
Suggested-by: Brand Huntsman <alpha@qzx.com>
2018-04-01 09:49:58 +02:00
Brand Huntsman 03bc19fd0c color: remove unneeded bright comparision to prevent duplicate pairs
Signed-off-by: Brand Huntsman <alpha@qzx.com>
2018-03-05 20:03:03 +01:00
Benno Schulenberg b027263a37 small addition: allow customizing the color of an error message
The new option 'set errorcolor' allows the user to specify the color
combination for the status bar when an error message is displayed.
2018-02-23 12:35:17 +01:00
Benno Schulenberg f72fecee9b copyright: update the years for the FSF
And one for me, for the much changed keyboard stuff.
2018-01-24 10:14:43 +01:00
Benno Schulenberg d5f9be7dc8 painting: look for an end match only after a start match, if any
This fixes https://savannah.gnu.org/bugs/?52925.

Reviewed-by: Brand Huntsman <alpha@qzx.com>
2018-01-22 11:03:40 +01:00
Benno Schulenberg 704a7d7b4f tweaks: rename two variables, for preciseness and shortness
Also remove an unneeded nulling.
2018-01-15 16:38:13 +01:00
Brand Huntsman 4b24ce1c11 startup: parse interface colors when they are read, not when initialized
When the palette is getting initialized, it is too late to send any
error messages about the rcfile options to standard error.

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

Signed-off-by: Brand Huntsman <alpha@qzx.com>
2018-01-15 13:04:55 +01:00
Benno Schulenberg 87206c0607 tweaks: convert the indentation to use only tabs
Each leading tab is converted to two tabs, and any leading four spaces
is converted to one tab.  The intended tab size (for keeping most lines
within 80 columns) is now four.
2017-12-29 20:06:50 +01:00
Benno Schulenberg e6a92b1406 painting: evade an ncurses bug by adding the A_PROTECT attribute
Adding the obscure A_PROTECT attribute to every color prevents an
occasional miscoloring of the first few rows on the screen -- when
ncurses is version 6.0 and dates from before October 17, 2015.

Original-idea-by: Brand Huntsman <alpha@qzx.com>
Tested-by: Brand Huntsman <alpha@qzx.com>

This fixes https://savannah.gnu.org/bugs/?52182.
2017-11-13 19:38:28 +01:00
Benno Schulenberg 5239e7c52b copyright: update some years, and standardize on the dashed format 2017-11-12 10:46:20 +01:00
Benno Schulenberg d5ac1ed395 tweaks: transform the token DISABLE_COLOR to ENABLE_COLOR 2017-11-01 19:45:50 +01:00
Benno Schulenberg 4436815725 help: don't fall back to other syntaxes if there is no nanohelp one
Also, an absent nanohelp syntax is not an error, so keep mum.

This fixes https://savannah.gnu.org/bugs/?52147.
2017-10-12 19:15:24 +02:00
Benno Schulenberg 7c3c3cbb3b tweaks: discard some obsolete debugging stuff 2017-09-22 21:59:51 +02:00
Benno Schulenberg 11072ed587 tweaks: sort the includes, so it's a little easier to see what is there 2017-08-06 19:40:30 +02:00
Benno Schulenberg 80686bb525 tweaks: remove includes that appear to be superfluous
Without them, nano still compiles for me, with everything enabled,
even when using --enable-debug, --enable-utf8, and --with-slang.
2017-08-06 09:08:30 +02:00
Benno Schulenberg 684fc8f84a tweaks: remove two superfluous includes
The precalculation of the multiline regexes no longer looks at the
keyboard every second, and the backup code makes use of futimens()
nowadays.
2017-07-11 18:07:40 +02:00
Benno Schulenberg ac726f08fa startup: don't try parsing color names that were not specified
Dereferencing a NULL pointer is never a good idea.

This fixes https://savannah.gnu.org/bugs/?51405.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>
2017-07-07 11:55:10 +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 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 c118397a14 tweaks: update some copyright years
Reflect the significant changes in painting and regex searching
in the copyright notices.
2017-02-21 20:27:49 +01:00
Benno Schulenberg 2358badc65 painting: properly detect a change in start/end matches
The inversion of the logic in commit a6605dce was incomplete -- oops.

This fixes https://savannah.gnu.org/bugs/?50306.
2017-02-14 16:56:43 +01:00
Benno Schulenberg 8fbadecf0a tweaks: adjust whitespace after preceding changes 2017-02-13 19:47:24 +01:00
Benno Schulenberg a6605dce00 tweaks: rename two variables, to avoid double negatives 2017-02-13 19:47:20 +01:00
Benno Schulenberg 9ec546d293 tweaks: rename a function, and drop an unneeded parameter
When replacements are made, nothing needs to be reset any more
(it was done insufficiently anyway).  Just make sure the screen
is refreshed when all is done -- this may be superfluous when
doing interactive replacements, but not when replacing all.
2017-02-13 19:47:03 +01:00
Benno Schulenberg 3b86c7a190 tweaks: discard the now unused multidata-resetting routine 2017-02-13 12:14:58 +01:00
Benno Schulenberg 7ef5c53263 painting: mark an unpaired start match as CWOULDBE
The lines that come after an unpaired start have to know about this.

This fixes https://savannah.gnu.org/bugs/?50293.
2017-02-13 11:18:54 +01:00