Commit Graph

9382 Commits (208146f2f285f08154bfa0db80b31be7109f1a99)

Author SHA1 Message Date
Benno Schulenberg 5ca2fd887a startup: initialize colors only when the terminal is capable of colors
This avoids trying to show colors on a vt100, for example.
2020-04-29 12:07:31 +02:00
Benno Schulenberg d1e1438ca0 tweaks: delete some unneeded code, and rename the function accordingly
When set_colorpairs() is called, no files have been loaded yet, so
no syntaxes will have been loaded yet either.  Thus it is pointless
to run through the list of available syntaxes.
2020-04-28 16:49:45 +02:00
Benno Schulenberg 382ec84248 tweaks: rename a function, to match with the boolean that guards it 2020-04-28 16:38:27 +02:00
Benno Schulenberg bc4240dda5 tweaks: rename a function, to better describe what it does
Its major function is to find an applicable syntax, if there is any.
And if the syntax hasn't been used before, to prime its color pairs.

Also, reshuffle a line to be able to elide an #ifdef.
2020-04-28 16:34:45 +02:00
Benno Schulenberg b97da1dfe4 files: reinitialize the palette only when the syntax actually changed 2020-04-28 15:30:00 +02:00
Benno Schulenberg e62a6964f7 syntax: sql: condense some regexes, and reduce their number 2020-04-26 19:32:44 +02:00
Benno Schulenberg fd70c25d21 menus: remove unneeded words and shortenings from key labels
In "Cut Text" and "Paste Text" the word "Text" is superfluous.  (It
could even be called slightly misleading, because by default ^K will
cut the current line, whether or not it contains text.)

The "Get Help" is of course inherited from Pico, but to me it has
always sounded a bit as if it would go search help on the internet.

Instead of "Spelling" I would have preferred "Spellcheck", but that
gets a bit too cramped on an 80-column terminal.

For ^C I've chosen "Location" because I tend to understand "Position"
as a verb, especially when seen next to "Go To Line" (even when having
two items with the same meaning next to each other doesn't make sense).

"Mark Text" has simply always been wrong.  It doesn't mark anything,
but just *sets* the mark (or unsets it, but that normally happens
automatically, no need to mention that in the label).

The "Cut Till End" and "Full Justify" get shown only on very wide
terminals, and at such widths there is enough room for each label
to write out those two labels in full.
2020-04-21 19:14:28 +02:00
Benno Schulenberg 227467adb9 syntaxes: remove some superfluous outer parentheses from regexes
Also, standardize some comments, condense a few regexes, add some
word-edge anchors, and remove some superfluous backslashes.
2020-04-21 12:49:29 +02:00
Benno Schulenberg afce41c754 syntaxes: move the rules for Fortran and Povray files down to extra/
Fortran and POV-Ray files are not found on any regular install of a
Unixy system nor in common software packages.  People who want these
syntaxes will have to make a little effort to enable them.
2020-04-21 12:11:44 +02:00
Ryan Westlund 36e22c99a1 syntax: haskell: new file -- coloring rules for Haskell programs
Adapted from the original coloring rules by Alex Taber found at:
  https://github.com/scopatz/nanorc/blob/master/haskell.nanorc

Signed-off-by: Ryan Westlund <rlwestlund@gmail.com>
2020-04-21 11:56:24 +02:00
Benno Schulenberg dd25d807df syntaxes: remove some stuff that has been commented out for a long time 2020-04-20 19:22:39 +02:00
Benno Schulenberg fea5d7c612 syntaxes: uniformize the initial comment 2020-04-20 19:21:56 +02:00
Benno Schulenberg c859fd40b6 syntax: markdown: do not colorize text between two bold words as italic
Also, do not colorize the text between two stricken-through words,
do not colorize text immediately after an indented piece of code,
but do give color to a double trailing space.

Signed-off-by: Ryan Westlund <rlwestlund@gmail.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2020-04-20 13:42:00 +02:00
Benno Schulenberg 890e12fc79 docs: note Marco as the original author of the bookmarking code 2020-04-16 11:05:14 +02:00
Benno Schulenberg ab1a5c7abb tweaks: rename two parameters, away from abbreviations 2020-04-15 17:50:59 +02:00
Benno Schulenberg 079a679431 tweaks: rename two functions, to better indicate what they do 2020-04-15 17:20:03 +02:00
Benno Schulenberg 56d1214187 syntax: move distro-specific files down to a subdirectory, syntax/extra/ 2020-04-14 19:05:41 +02:00
Benno Schulenberg fb53ad9c3a syntax: markdown: new file -- coloring rules for Markdown files
First-draft-by: Ryan Westlund <rlwestlund@gmail.com>
2020-04-14 16:15:49 +02:00
Benno Schulenberg 5755ecdbfc options: let --afterends affect also the deleting of words (Ctrl+Delete)
It makes more sense that <Ctrl+Delete> deletes the same thing as what
<Shift+Ctrl+Right> would select.

Suggested-by: Liu Hao <lh_mouse@126.com>
2020-04-14 12:14:49 +02:00
Benno Schulenberg bcaa1ef7f2 docs: explain how anchors work, and document their bindable functions 2020-04-13 12:20:36 +02:00
Benno Schulenberg 9bb9a747e2 feedback: indicate an anchor with a "+" in the line-number margin 2020-04-13 11:48:36 +02:00
Benno Schulenberg e86180119e tweaks: implement the anchor routines in a different way 2020-04-13 11:35:40 +02:00
Benno Schulenberg 40053593a8 general: rename "bookmark" to "anchor", to sound less permanent 2020-04-13 11:25:29 +02:00
Benno Schulenberg 732cf88786 text: retain a bookmark when two lines are joined or something is cut
Also, do not copy the bookmark into the cutbuffer, so it will not get
pasted elsewhere.
2020-04-13 11:10:23 +02:00
Marco Diego Aurélio Mesquita 9fb0beca1d bindings: hard-bind the bookmark functions to M-Ins and M-PgUp/M-PgDn
Bind the toggling of a bookmark to <Alt+Insert>, and the jumping to the
previous and next bookmark to <Alt+PageUp> and <Alt+PageDown>, so that
these functions are available by default.

Signed-off-by: Marco Diego Aurélio Mesquita <marcodiegomesquita@gmail.com>
2020-04-13 10:51:40 +02:00
Marco Diego Aurélio Mesquita f091c34bac new feature: bindable functions for toggling and jumping to "bookmarks"
With the 'bookmark' function, the user can place a bookmark on any
line in the buffer.  Multiple lines can be bookmarked in this way.
With 'prevbookmark' and 'nextbookmark', the user can then easily
return to the bookmarked lines.  The search for a bookmark wraps
around, as if start and end of buffer are connected.

[However, in this implementation, when a bookmarked line is deleted,
the bookmark is deleted too.  This is undesirable.  Also, when such
a deleted line is pasted elsewhere, the bookmark reappears with it,
and when pasted multiple times, the bookmark will be there as many
times.  This is thoroughly undesirable.  These behaviors will be
changed in a later commit.]

A bookmark is not yet visible in any way.

This fulfills https://savannah.gnu.org/bugs/?57577.
Requested-by: Ken Tyler <kent@werple.net.au>

Signed-off-by: Marco Diego Aurélio Mesquita <marcodiegomesquita@gmail.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2020-04-13 10:51:40 +02:00
Benno Schulenberg fd9f6e4619 syntax: mgp: drop the almost-empty MagicPoint file and syntax
It colored any word after a % sign.  But a good syntax would color
only the valid commands, and also the ones after a comma.
2020-04-12 10:40:29 +02:00
Benno Schulenberg 4f9bebddec syntax: email: rename file and syntax, away from the mistaken 'mutt'
Also, colorize lines that are multiply quoted, and email addresses,
and URLs.
2020-04-10 13:01:57 +02:00
Benno Schulenberg edf2d8d68f docs: mention that the dedicated cursor-moving keys are not rebindable 2020-04-10 12:25:02 +02:00
Benno Schulenberg 654d694e39 tweaks: simplify the counting of characters in a section
The line after the given section is always NULL (or when it is not,
it is intended to be NULL), so always subtract 1 at the end.
2020-04-09 12:58:41 +02:00
Benno Schulenberg 19a6120dc8 tweaks: rename a function, to be more general and clearer 2020-04-09 12:27:07 +02:00
Benno Schulenberg f4a33b868a tweaks: delete the now-unused partitioning and unpartitioning routines 2020-04-09 12:12:04 +02:00
Benno Schulenberg cd3db5fcc4 cutting: change the implementation of cutting to not use partitioning
This has the pleasing effect of not changing the linestruct of the
succeeding line when a line is cut.

This addresses https://savannah.gnu.org/bugs/?56226.
2020-04-09 11:45:10 +02:00
Benno Schulenberg ae5a4ecee2 cutting: overhaul the pasting routine, to not make use of partitioning
This has the pleasing effect of not changing the linestructs of the
current line nor of the line after it (if any).
2020-04-09 11:29:44 +02:00
Benno Schulenberg fd4a5fc473 files: write out a marked region without partitioning the buffer
Use the same mechanism as when copying a marked region: temporarily
clipping the buffer.
2020-04-09 11:07:05 +02:00
Benno Schulenberg 66e64dd2d2 docs: in the sample nanorc file, refer instead of duplicating
Instead of duplicating information, just refer to 'man nanorc'.

Also reshuffle a paragraph, and add a suggestion to just select
the syntax files that will actually get used.
2020-04-09 10:27:39 +02:00
Benno Schulenberg a0119b83ca tweaks: add two comments, and improve another 2020-04-08 11:25:02 +02:00
Benno Schulenberg dba7a8a70a copying: do not forget to update the screen when M-6 is pressed
This fixes https://savannah.gnu.org/bugs/?58140.

Bug existed since commit f52b6cf1 from one week ago.
2020-04-08 11:04:35 +02:00
Benno Schulenberg 5c3a22dbd6 tweaks: rename a function, to be more precise, and reshuffle some things 2020-04-07 19:19:26 +02:00
Benno Schulenberg b70510f4be docs: copy the 4.9.2 news item from the release branch 2020-04-07 14:35:42 +02:00
Benno Schulenberg 2d4bacf61d docs: stop mentioning that --wordchars overrides --wordbounds
Since the previous commit, it no longer does.  Instead, the two
interfere, and the user probably wants to use just one of them.
2020-04-06 19:07:02 +02:00
Benno Schulenberg 547de4a7bb counting: count words correctly also when --wordchars is used
It should give the same result as 'wc -w' as long as the content
of 'wordchars' does not affect the counting.

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

Bug existed since version 2.6.2, since the --wordchars option was
introduced in commit 6f12992c.
2020-04-06 11:17:43 +02:00
Benno Schulenberg 845a5973c9 counting: count words and characters without partitioning the file 2020-04-05 17:29:54 +02:00
Benno Schulenberg 6e5195f650 tweaks: invert a condition, to have two clauses in a more logical order
First the clause for the intro text and the normal lines, and then the
clause for the continuation lines (that are narrower and indented).

Also, avoid blanking the status bar when initializing the subwindows
anyway, and avoid an unneeded resfreshing call -- the bottombars()
function will take care of that.
2020-04-03 17:19:15 +02:00
Benno Schulenberg f3624b1b87 build: fix compilation when configured with --enable-tiny 2020-04-03 17:12:28 +02:00
Benno Schulenberg 1a2c9044d7 display: blank the status bar for a copy operation, like for cut & paste
This way an earlier "Copied nothing" or other message cannot confuse
the user.
2020-04-03 16:34:27 +02:00
Benno Schulenberg 9a67d7958f undo: choose the proper x positions to place the cursor and rejoin lines
Normally, when undoing an <Enter> that created automatic indentation,
the created whitespace should be skipped when rejoining the two lines.
In other words: take the data starting from tail_x in the second line.
But when the <Enter> occurred at the end of leading whitespace, then
that whitespace has disappeared from the original line and it should
be copied back in from the second line.  That is: from x is zero.

This fixes https://savannah.gnu.org/bugs/?58108.
Reported-by: Liu Hao <lh_mouse@126.com>

Bug existed since version 4.9, commit 1961c052.
2020-04-03 11:21:24 +02:00
Benno Schulenberg 23f73cb8b3 tweaks: exit from the writing loop as soon as the last line is reached
Avoid having to decrement the count in order to offset the increment
at the end of the loop.

Also, declare a variable on a separate line, and rename it.
2020-04-01 16:05:45 +02:00
Benno Schulenberg 9f6962f3f1 tweaks: condense a comment, and express a condition in a different way 2020-04-01 15:54:08 +02:00
Benno Schulenberg 958e3ec201 feedback: show a message also when trying to copy an empty region 2020-03-31 19:44:32 +02:00