Commit Graph

287 Commits (43f35fc7a9b8ced075ce43e0e6c598992a430e1f)

Author SHA1 Message Date
Rishabh Dave 01bf034bb6 rcfile: reject rebindings that have no effect or have side effects
Also, show in green only the ^ and M- combinations that are valid.

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

Signed-off-by: Rishabh Dave <rishabhddave@gmail.com>
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-10-11 19:46:18 +02:00
Rishabh Dave e2027aee15 rcfile: reject key names that are wrong or too long
Meta keys should have a dash as second character, and apart from ^Space
and M-Space key names should be at most two or three characters long.

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

Reviewed-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Rishabh Dave <rishabhddave@gmail.com>
2016-09-14 19:53:38 +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 b92d35d1f2 browser: add the option showcursor, to place the cursor on the highlight
This lets users of braille displays find the selected item immediately.

This fulfills a request by Enrico Mioso.
See https://lists.gnu.org/archive/html/nano-devel/2016-09/msg00025.html.
2016-09-11 09:41:52 +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 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 1e5614b31b tweaks: avoid two compiler warnings 2016-07-22 15:48:06 +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 d88423eaae tweaks: move a debug statement to its proper place, and improve aspect 2016-07-13 20:48:03 +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 cdcd365d34 tweaks: normalize some whitespace 2016-05-17 11:33:21 +02:00
Benno Schulenberg f1b9ba2781 rcfile: make an error message equal to another, and more informative 2016-05-04 10:22:28 +02:00
Benno Schulenberg 9330aa60a5 rcfile: disallow 'bind' and 'unbind' in an included file
Included files are meant to contain only syntax definitions; they may
not set or unset options, nor rebind keys, nor include other files.

This fixes https://savannah.gnu.org/bugs/?47391.
2016-04-27 10:07:45 +02:00
Benno Schulenberg d92eb4fee3 all: eradicate SVN's $Id$ tags 2016-04-05 14:59:12 +02:00
Benno Schulenberg 2f817a6740 Checking for the existence of the REG_ENHANCED regex flag, and
using it when it's available (which it is on OS X systems).
This completes the fix for Savannah bug #47325.
Patch by Thomas Rosenau.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5759 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-22 10:42:28 +00:00
Benno Schulenberg 8866f728a2 Rearranging some things to reduce the indentation level by four steps,
so we can unwrap a dozen lines.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5737 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-14 17:14:35 +00:00
Benno Schulenberg 7070812004 Making an error message equal to others, to reduce the msgid count.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5736 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-14 16:09:52 +00:00
Benno Schulenberg 8fbb922868 Renaming a variable, from 'endcolor' to 'lastcolor', to fully avoid
the idea that it might have something to do with 'end_regex'.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5733 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-13 20:05:36 +00:00
Benno Schulenberg 6ed6462154 Combining the regular-expression flags at compile time instead of at run time.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5732 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-13 19:37:21 +00:00
Benno Schulenberg 63d59656d3 Refinding the tail of the colors list only when extending,
not for every added color, thus saving some 15 microseconds.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5729 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-12 11:15:12 +00:00
Benno Schulenberg f72e16502e Renaming a variable.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5728 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-12 10:21:02 +00:00
Benno Schulenberg fa82824a59 Reducing the indentation by short-circuiting a loop.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5727 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-12 09:52:16 +00:00
Benno Schulenberg 3cb80ff7ea Renaming two functions, to be more distinguishable --
a leading underscore as the only difference is not enough.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5726 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-12 09:43:10 +00:00
Benno Schulenberg 1786484486 Fixing compilation when configured with --enable-tiny plus --enable-nanorc.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5722 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-11 17:14:30 +00:00
Benno Schulenberg d08d72a05d Checking for an open syntax first, before checking it is named "default".
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5721 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-11 16:51:15 +00:00
Benno Schulenberg 6e37723fbe Eliding a variable.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5720 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-11 16:45:00 +00:00
Benno Schulenberg b8aae4d872 Tweaking some comments and reshuffling/reindenting some lines.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5719 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-11 16:39:27 +00:00
Benno Schulenberg 8a5ae2130b Renaming a variable to better fit its new role.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5717 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-10 20:36:12 +00:00
Benno Schulenberg 04262f09a4 Turning the linked list of syntaxes upside-down, so that the last-defined one
comes first, so that a search can stop at the first match instead of always
having to run through the entire list.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5716 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-10 20:06:01 +00:00
Benno Schulenberg ed296525f4 Eliding the functions parse_header_exp() and parse_magic_exp(),
and reshuffling the parameters in grab_and_store().


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5715 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-10 11:00:59 +00:00
Benno Schulenberg 837b4e66e2 Folding the parsing of a linter and formatter command into a single routine.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5714 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-10 10:36:49 +00:00
Benno Schulenberg 2994ea9d02 Not accepting 'header" and 'magic' commands for the default syntax.
This fixes Savannah bug #47323.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5713 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-10 09:46:21 +00:00
Benno Schulenberg 2f63e8dfc1 Using the grab_and_store() function also for gathering up extension regexes.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5712 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-09 21:00:42 +00:00
Benno Schulenberg b0bdfbb0f7 Producing an adequate error message when the syntax name is improperly quoted.
This fixes Savannah bug #47324.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5711 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-09 20:28:50 +00:00
Benno Schulenberg 6a4d3aad80 Tweaking a few things and renaming a variable.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5710 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-04 20:50:38 +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 3df1a3f0f4 Not bothering to discard a duplicate syntax -- selecting simply the
last-defined one.  This addresses Savannah bug #47303.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5704 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-01 11:06:00 +00:00
Benno Schulenberg e39423b49d Fixing breakage of r5695 -- I confused nregcomp() with regcomp(). :(
Hhrr...  Names that don't seem to differ...


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5702 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-29 15:40:13 +00:00
Benno Schulenberg 04669b5635 Renaming a variable and reshuffling a few lines.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5701 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-29 12:17:53 +00:00
Benno Schulenberg 85e166b0f2 "Closing" an extended syntax again, to prevent sneakily extending
the last-defined syntax.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5700 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-29 12:04:22 +00:00
Benno Schulenberg 773fc447df Arranging some things more orderly.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5699 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-29 10:54:48 +00:00
Benno Schulenberg 717e697e0b Not allocating a struct for the "none" syntax -- it doesn't need any.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5698 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-29 10:29:52 +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 275e9f0092 Disallowing the addition of further things to a syntax when
an rcfile ends or when an invalid syntax command is found.
This fixes Savannah bug #47207


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5696 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-28 20:38:14 +00:00
Benno Schulenberg 68d94a0c74 Rearranging a few things in my style.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5695 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-28 17:16:39 +00:00
Benno Schulenberg 07f71e6c1a Not dropping regexes that were gathered earlier.
This fixes Savannah bug #47285.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5694 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-28 16:36:23 +00:00