Commit Graph

5727 Commits

Author SHA1 Message Date
Benno Schulenberg
c38ffdc741 tweaks: rename two variables, to match others 2016-07-25 10:53:49 +02:00
Benno Schulenberg
a472f480a7 tweaks: trim some comments, and simplify a condition 2016-07-24 13:44:16 +02:00
Benno Schulenberg
4416d9c941 tweaks: shuffle the resetting of a counter to the tail of the routine 2016-07-24 13:15:45 +02:00
Benno Schulenberg
c073c5ae54 tweaks: don't bother resetting the Unicode code holder
It will be initialized when a new code is started.
2016-07-24 13:09:24 +02:00
David Lawrence Ramsey
fc0ddab349 input: provide feedback on the Unicode digits typed so far
This fulfills https://savannah.gnu.org/bugs/?48154.
2016-07-24 12:19:42 +02:00
Benno Schulenberg
c6dbcf91c3 new feature: functions to jump to previous or following block of text
And hard-bind the keys Ctrl+Up and Ctrl+Down to these functions.

Unlike the paragraph-jumping code, these new functions disregard
any indentation, treating only blank lines as separators.  They
also do an automatic smart home when that option is set.

This fulfills https://savannah.gnu.org/bugs/?48291.
2016-07-24 12:00:00 +02:00
Benno Schulenberg
8c7a38596d screen: include a workaround only when compiling against older ncurses
The bug with a leading wide character has been fixed since ncurses-5.9.

See https://savannah.gnu.org/bugs/?31743 for reference.
2016-07-24 10:38:31 +02:00
Benno Schulenberg
1c2d2a4027 tweaks: adjust a comment for removed definitions 2016-07-22 15:57:20 +02:00
Benno Schulenberg
1e5614b31b tweaks: avoid two compiler warnings 2016-07-22 15:48:06 +02:00
Benno Schulenberg
04b9b9c78b tweaks: avoid a runtime error when compiled with -fsanitize=undefined
This fixes https://savannah.gnu.org/bugs/?48540.
2016-07-22 15:39:45 +02:00
Benno Schulenberg
41ad376b70 chars: plug a gushing memory leak 2016-07-22 15:30:09 +02:00
Dirkjan Ochtman
1349c1d02c syntax: allow capital letters in Rust struct/trait names
Per https://doc.rust-lang.org/reference.html#fn2, non-ASCII characters are
currently not allowed in stable Rust, so keep it ASCII-only for now.

Signed-off-by: Dirkjan Ochtman <dirkjan@ochtman.nl>
2016-07-21 10:21:19 +02:00
Rishabh Dave
4c566c7903 tweaks: reduce the number of wattron/wattrof calls
Also, compose the coloring attributes during initialization
instead of every time when painting something.

Signed-off-by: Rishabh Dave <rishabhddave@gmail.com>
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-07-21 10:10:59 +02:00
Benno Schulenberg
73a07215cc debug: remove duplicate information 2016-07-21 09:54:07 +02:00
Benno Schulenberg
bf091be778 chars: don't try to see a character in an empty line
This fixes https://savannah.gnu.org/bugs/?48578.
2016-07-21 09:46:47 +02:00
Benno Schulenberg
103dd06347 input: don't crash when the window is resized during verbatim input
Instead of referring to a window that might have been deleted by a
resize, just turn the keypad back on for the two windows from which
input might have been requested.

Also: don't insert KEY_WINCH as the verbatim keystroke.

This fixes https://savannah.gnu.org/bugs/?48532.
2016-07-17 12:18:12 +02:00
Benno Schulenberg
1d4c1e0bfc input: plug a memory leak
This fixes https://savannah.gnu.org/bugs/?48538.
2016-07-17 12:00:33 +02:00
Benno Schulenberg
b3fbb7c7ff input: report keystroke M-[ as being unbindable instead of just unbound 2016-07-16 14:05:33 +02:00
Benno Schulenberg
225203d40d tweaks: correct a comment 2016-07-16 13:29:50 +02:00
Benno Schulenberg
c2a0c78d9b tweaks: rename a variable and a type, to be less confusing 2016-07-16 13:29:50 +02:00
Benno Schulenberg
97f4fe26f0 build-sys: ignore the revision header file 2016-07-16 13:29:13 +02:00
Benno Schulenberg
ef071255e5 color: refresh the screen whenever the active syntax changes
This fixes https://savannah.gnu.org/bugs/?47296.
2016-07-14 17:51:33 +02:00
Benno Schulenberg
afb6a5b86d color: forget about aborting the precalculation for multiline regexes
This fixes https://savannah.gnu.org/bugs/?48389.
2016-07-14 14:31:14 +02:00
Benno Schulenberg
a37cd9f0ef tweaks: rename a variable, to clarify it refers to columns, not to bytes 2016-07-14 14:28:15 +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
Benno Schulenberg
8b28de1313 tweaks: don't call a thing malloc... when it doesn't call malloc() 2016-07-13 15:04:40 +02:00
Rishabh Dave
8fa72fb7e7 browser: elide a variable by fusing the uses of 'newpath' and 'path'
Signed-off-by: Rishabh Dave <rishabhddave@gmail.com>
2016-07-13 14:30:18 +02:00
Benno Schulenberg
b4babc2036 input: accept only the four iTerm sequences that actually get handled
This fixes https://savannah.gnu.org/bugs/?48455.
2016-07-13 13:01:46 +02:00
Benno Schulenberg
f2150d3f98 input: treat Ctrl+Alt+key different from Esc followed by Ctrl+key
When the user changes her mind after having pressed Esc, she cannot
unpress Esc, so do that for her by ignoring the escape code when
the subsequent keycode is outside of the normal printable range.

This restores the behavior from before nano-2.3.5 -- except that
Ctrl+Alt+key continues to report an unbound key.

This fixes https://savannah.gnu.org/bugs/?48459.
2016-07-13 10:01:07 +02:00
Benno Schulenberg
033376aec0 input: consider only O, o and [ as starters of multi-character sequences
This prevents many keycode sequences from being misconstrued when a
command key plus other keystrokes accumulate in the input buffer.

This fixes https://savannah.gnu.org/bugs/?48395.
2016-07-13 09:56:24 +02:00
Benno Schulenberg
e33a0b6dbe screen: avoid converting each character twice from multibyte to wide 2016-07-12 19:41:13 +02:00
Benno Schulenberg
0894587305 screen: elide another intermediate buffer for every visible character 2016-07-12 19:30:50 +02:00
Benno Schulenberg
960e848cc7 tweaks: elide a typedef, as it now has just one element 2016-07-12 09:35:48 +02:00
Benno Schulenberg
b4737072a6 tweaks: delete an element that is always FALSE and never used 2016-07-12 09:24:32 +02:00
Benno Schulenberg
8507dd4bd0 color: integrate the hilite attribute into the pair number
Color-pair numbers and attributes can be OR'd together -- do so,
to save an attron() call whenever the hilite is on.
2016-07-12 09:20:09 +02:00
Benno Schulenberg
62eeda3e9f tweaks: use mallocstrcpy() instead of strdup(), for a graceful death
To make nano save its modified buffers when it runs out of memory.
2016-07-11 20:45:26 +02:00
Benno Schulenberg
06c806215e tweaks: improve two comments 2016-07-11 20:11:29 +02:00
Benno Schulenberg
d2b25120f0 tweaks: fuse two handlings of a delete key, and fix a comment 2016-07-10 21:36:25 +02:00
Benno Schulenberg
0c319f8b4b tweaks: put the case labels (the keycodes) in a more sensible order 2016-07-10 20:49:52 +02:00
Benno Schulenberg
4fcc760158 tweaks: put some case labels closer to their statements
Also condense some comments, and group keys with the same result together.
2016-07-10 20:38:08 +02:00
Benno Schulenberg
0d5f918453 input: add some missing keycodes to the parsing routine
Add them so that <Esc> followed by <Home> will simply do "Home" instead of
reporting an unbound key.  The same for <End>, <PageUp> and <PageDown>.

This restores the behavior from before nano-2.3.5.
2016-07-10 20:21:11 +02:00
Rishabh Dave
9c7940b599 utils: accept mistypings and common separators between line and column
It is easy to type beside the comma key and hit instead "m" or ".", so
accept also these as a separator between line and column number.  And
when being generous anyway, also accept space, slash and semicolon.

This fulfills https://savannah.gnu.org/bugs/?48305.

Signed-off-by: Rishabh Dave <rishabhddave@gmail.com>
2016-07-04 22:04:24 +02:00
Benno Schulenberg
ccfb1eb0f1 tweaks: rearrange a function in my style, and rename a variable 2016-07-04 21:50:12 +02:00
Benno Schulenberg
7e3a9c3aa6 utils: don't bother to check line and column for NULL
When parsing a line and a column number, of course the found values
need to be passed back, otherwise it would be pointless to parse them.
2016-07-04 21:42:04 +02:00
Benno Schulenberg
a730b25ef9 browser: elide another call of opendir()
And in the bargain show an error message when doing ^R unreadabledir ^T.
2016-07-04 21:18:09 +02:00
Benno Schulenberg
500fef8314 tweaks: rename a variable -- to match others and to be more concise 2016-07-04 13:43:19 +02:00
Benno Schulenberg
29986e95a0 input: don't drop the first byte when user starts typing during loading
Precalculation of the multiline color data can be cut short when the
user is impatient and starts typing.  But this would drop the first
byte of whatever was typed -- not nice when it was just plain text,
but surprising and worse when the first keystroke was a command.

This fixes https://savannah.gnu.org/bugs/?48388.
2016-07-04 09:27:35 +02:00
Benno Schulenberg
4af1da7d95 color: push the resets further when start and end match are equal
When for a multiline syntax-coloring rule the starting regex matches at
the exact same spot as the ending regex, do a second round of resets, so
that reevaluation starts further back and gets a few more things right.

This mildly fixes https://savannah.gnu.org/bugs/?47420.
2016-07-03 16:23:54 +02:00
Benno Schulenberg
528b79b5f3 tweaks: rename a variable to be more accurate
When we get a ^J as verbatim input, it is not possible to include it
into the file buffer or the prompt answer, because this would mean
adding an encoded null to the buffer or answer, and that is not what
the user intended.  One option would have been to simply ignore a ^J
in verbatim input.  But the choice has been made to act the same way
as when the ^J (0x0A) is found in the file data: start a new line.

That is the same response as to the Enter key, yes -- but the code
for the Enter key is ^M (0x0D), not ^J.  So, to be more precise,
rename the relevant variable from 'got_enter' to 'got_newline'.
2016-07-03 16:19:27 +02:00