Commit Graph

9264 Commits (93b25ce014a41c355f34c274d09c031a81417f5b)

Author SHA1 Message Date
Benno Schulenberg 8a5449cebe input: allow also a Meta keystroke to abort a Search command
(Still, this does not allow a full escape sequence to be used as
the Cancel command, but I think that is an acceptable limitation,
because 1) nobody ought to be using --rawsequences, and 2) very
few people will bind Cancel to something like F3 or Ins.)

This improves the fix for https://savannah.gnu.org/bugs/?58825.
2020-08-20 09:17:03 +02:00
Benno Schulenberg 9229834935 search: poll the input stream directly, not nano's own keystroke buffer
When checking (during a Search command) whether the user has pressed
the Cancel keystroke, look at ncurses' input stream directly instead
of at nano's own keystroke buffer, because the latter may contain the
copied keystrokes of a macro and we don't want to discard those.

(This does not yet allow a Meta keystroke to be used for Cancel, but
the next commit will fix that.)

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

Bug existed since version 2.9.0, since the macro was introduced.
2020-08-20 08:25:26 +02:00
Benno Schulenberg 6469e9668b tweaks: condense two declarations 2020-08-19 16:52:28 +02:00
Benno Schulenberg 68d71f649e rcfile: make sure that "bright"/"light" are prefixes, not separate words
This fixes https://savannah.gnu.org/bugs/?58984.

The bug was old -- it existed since at least version 2.0.6.
2020-08-19 16:18:29 +02:00
Benno Schulenberg 71752f47cb docs: reshuffle the section about the file browser to a better place
First mention the three main 'pieces' of the editor: Editing window,
Help viewer, and File browser.  Then mention how to change settings:
with the toggles or with nanorc files.
2020-08-19 08:54:30 +02:00
Benno Schulenberg 51f27d3f0c input: hold on to a shift-selected region when an unbound key is struck
There is no reason to deselect the region, as nothing has changed.

(This also retains the shift-selected region when a non-shortcut key is
typed in view mode, which makes sense, as again nothing was changed.)

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

Bug existed since version 4.9, commit 0ed62e84.
2020-08-19 08:36:00 +02:00
Benno Schulenberg b38265cfb8 search: retain the current answer when something is toggled
This fixes https://savannah.gnu.org/bugs/?58972.

Bug existed since version 5.0, commit bccb0ea0.
2020-08-18 09:17:39 +02:00
Benno Schulenberg b5fb41e963 docs: mention in the FAQ how to change the escape sequences of urxvt
Replace an obsolete question that doesn't have a good answer: setting
TERM to vt100 is unlikely to make the more complicated keystrokes work,
which are the ones that are most likely not to work.
2020-08-18 09:00:56 +02:00
Benno Schulenberg a14c894325 docs: add a cross-reference from 'findbracket' to 'set matchbrackets' 2020-08-17 14:20:03 +02:00
Benno Schulenberg bc6b9bf955 tweaks: rename a variable, to not seem to refer to the scrollbar 2020-08-17 13:36:03 +02:00
Benno Schulenberg 4b6090ded3 replacing: do not try to wipe nonexistent multidata, to avoid crashing
This fixes https://savannah.gnu.org/bugs/?58970.
Reported-by: Matteo Raso <mraso@uoguelph.ca>

Bug existed since version 5.0, commit 569d0056.
2020-08-17 10:05:25 +02:00
Benno Schulenberg fb98f0ced7 tweaks: adjust a comment, and reshuffle the setting of a boolean 2020-08-15 16:07:30 +02:00
Benno Schulenberg d09055db43 input: dawdle after an ESC also when --rawsequences is used
When keypad() is set to FALSE, like for verbatim input, ncurses is
not waiting its fifty milliseconds after an ESC to see if another
code will follow it, so nano itself will have to pause a little.

Otherwise 'solitary' could get set to TRUE when in fact the ESC
is followed very closely by another code.

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

Bug existed since version 2.6.2, commit f2150d3f.
2020-08-15 14:45:02 +02:00
Benno Schulenberg 50b61bef6f input: discard any multibyte character when <Alt> is being held
Otherwise the <Alt> key would simply be ignored.  It's better to reject
the combination, to compel the user to be precise in what they type.
2020-08-15 14:00:53 +02:00
Benno Schulenberg 3d0bfb0a00 input: do not enter invalid bytes when holding down both Alt keys
This fixes https://savannah.gnu.org/bugs/?58954.

Bug existed since version 5.1, commit 49231191.
2020-08-15 13:18:48 +02:00
Benno Schulenberg 3cb55c8b27 verbatim: reserve enough space for the result also in non-UTF-8 locales
Also when each character is just one byte, parse_verbatim_kbinput()
can produce two bytes; plus the terminating NUL that is three bytes.

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

Bug existed since version 4.9, commit 03d296eb.
2020-08-15 11:55:48 +02:00
Benno Schulenberg 306906a8a7 docs: adjust description of ^T in cheatsheet, and mention M-Bsp 2020-08-13 07:21:21 +02:00
Benno Schulenberg 6e2c245ecc po: update translations and regenerate POT file and PO files 2020-08-12 08:35:14 +02:00
Benno Schulenberg 74a0ffcbc5 tweaks: baptize the release 2020-08-12 08:24:06 +02:00
Benno Schulenberg b1a0f5e65a bump version numbers and add a news item for the 5.1 release 2020-08-12 07:57:31 +02:00
Benno Schulenberg 7e8b1ed420 build: stop distributing the two old Changelogs
For installing and using nano, those two Changelogs are useless,
and for inspecting the history of nano, 'git log' is much better.

Only the most recent Changelog is somewhat useful for some users,
for walking in some detail through the changes that were made in
the last few versions.
2020-08-11 20:12:56 +02:00
Benno Schulenberg b2ea7d29d0 build: fix compilation for --enable-tiny --enable-nanorc --enable-color 2020-08-11 20:10:40 +02:00
Benno Schulenberg e597ad4908 build: fix compilation when configured with --enable-tiny 2020-08-11 19:59:24 +02:00
Benno Schulenberg 100747f56b verbatim: discard entire keystroke when it's not valid for Unicode Input
This will not work for the deviant escape sequences for F1 to F5
on the Linux console nor for Alt+arrow on urxvt and such, but...
I can't be bothered to handle those too.

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

Bug existed since commit be203832 from earlier today.
2020-08-10 16:18:03 +02:00
Benno Schulenberg d7b2b55bf5 display: show the cursor position also right after the screen is resized
Bug existed since commit 8e226a9f from half an hour ago.
2020-08-10 12:16:18 +02:00
Benno Schulenberg 9875252fd7 tweaks: remove an unneeded beep, and reshuffle the lines for compactness
The beep is produced later, after get_verbatim_kbinput() returns.
2020-08-10 12:07:16 +02:00
Benno Schulenberg 1551c1c771 verbatim: do not report "Invalid code" when a Unicode character is typed
This fixes https://savannah.gnu.org/bugs/?58928.

Bug existed since version 5.0, commit 5899181a.
2020-08-10 11:48:31 +02:00
Benno Schulenberg 8e226a9f28 verbatim: do not report "Invalid code" when the terminal is resized
During verbatim input at most four integers are produced (the longest
possible unicode sequence), so use the value 999 to indicate a special
condition (a screen resize) that should not enter anything into the
buffer AND should not produce any error message or beep.

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

Bug existed since version 5.0, commit 5899181a.
2020-08-10 11:42:09 +02:00
Benno Schulenberg be20383240 verbatim: report and ignore an invalid keystroke for Unicode input
When Unicode Input has started (by typing 0 or 1 at the Verbatim Input
"prompt"), and something is typed that is not a hexadecimal digit, then
don't try to enter this character into the buffer but simply report it
as invalid and ignore it.  Because most likely the user mistyped and
actually meant to enter a valid hex digit.

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

The bug was old -- it existed since at least version 2.0.6.
2020-08-10 09:31:24 +02:00
Benno Schulenberg cf769bbd2f tweaks: adjust the indentation after the previous change 2020-08-10 07:55:00 +02:00
Benno Schulenberg 4ec96f9f2e tweaks: reshuffle a few lines, to condense the code, and improve comment 2020-08-10 07:53:41 +02:00
Benno Schulenberg bdc856812f tweaks: read keycodes from the keystroke buffer without copying them
Allocating and freeing memory for reading every single keycode
is a waste of time and effort.

This addresses https://savannah.gnu.org/bugs/?58806.
2020-08-10 07:39:29 +02:00
Benno Schulenberg 96bb8149e9 moving: make <Ctrl+Up> go to the top when above the cursor all is blank
Just like <Ctrl+Down> goes to the end of the buffer when after the
cursor there are only blank lines.

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

Bug existed since version 2.6.2, since <Ctrl+Up/Down> were introduced.
2020-08-09 16:57:25 +02:00
Benno Schulenberg 07e69d54b2 tweaks: elide two variables that are no longer needed, and update comment 2020-08-09 15:40:53 +02:00
Benno Schulenberg aeb15e9549 tweaks: parse the escape-sequence bytes without copying them first 2020-08-09 15:25:22 +02:00
Benno Schulenberg 435d9acb5c tweaks: exclude old and mistaken "Esc O" sequences from the tiny version
The correct sequences begin with "Esc [" instead.  I cannot find in the
histories of VTE and Gnome Terminal when these sequences were corrected.

Also exclude a bug check from the tiny version.
2020-08-09 10:48:03 +02:00
Benno Schulenberg 12fe0a3b29 tweaks: normalize the indentation after the previous change
This finally gets rid of the piece of specially reduced indentation
(<-<- ... ->->) that made it hard to see the structure of the code.
2020-08-09 10:48:03 +02:00
Benno Schulenberg c14e77ce9e tweaks: split a function into two, one for "Esc O" and one for "Esc [" 2020-08-09 10:48:03 +02:00
Benno Schulenberg 2c8c061e67 tweaks: pass first byte of sequence directly to the decoding function
Don't bother stuffing it back into the keyboard buffer when it will be
taken out again straight afterward.
2020-08-09 10:48:03 +02:00
Benno Schulenberg 5fab1e6754 verbatim: pause a little after an ESC, to not miss a succeeding code
When we get an ESC from the keyboard, it might be the start of an
escape sequence, but the keyboard routines will need a little time
(tens of microseconds, probably) to get these codes to ncurses.
So, when doing verbatim input, pause a moment after an ESC.

This completes the fix for https://savannah.gnu.org/bugs/?58909.
2020-08-08 07:51:47 +02:00
Benno Schulenberg b0e3767af5 input: understand M-Bsp also when terminfo does not match the terminal
Always interpret ESC followed by BS or DEL as <Alt+Backspace>.

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

Bug existed since commit 40b03162 from one week ago,
since M-Bsp was hard-bound to deleting a word backwards.
2020-08-07 19:17:36 +02:00
Benno Schulenberg 4923119174 tweaks: reshuffle some fragments, to make the next change easier 2020-08-07 18:46:55 +02:00
Benno Schulenberg cdd6882541 verbatim: insert the full code sequence when <Alt+Backspace> is pressed
(This could lead to unwanted behavior when the user wants to enter
a literal escape character (0x1B) while the input is somehow getting
stalled, because then a command keystroke after the M-V <Esc> would
get inserted verbatim too, instead of getting acted upon.  But that
is a small price to pay for getting the correct behavior for both
M-V M-Bsp and M-V M-Enter.)

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

Bug existed since version 2.6.3, commit 08c51cfd,
but also occurred erratically beforehand.
2020-08-07 16:21:21 +02:00
Benno Schulenberg 5a6a74fe70 gnulib: update to its current upstream state 2020-08-06 16:03:03 +02:00
Benno Schulenberg d7c2b98ead feedback: when creating a pipe fails, report also the reason
After commit 59bbc0b8 from five days ago (that made a divergent pipe
failure to be treated in the same way as the other two), this became
possible without having two different pipe-failure messages.
2020-08-06 08:47:52 +02:00
Benno Schulenberg 4c63ef204d tweaks: make a few more direct returns, and reshuffle another bit of code 2020-08-05 11:03:35 +02:00
Benno Schulenberg 4c6b6cad99 tweaks: elide an unneeded variable, by transforming the key code directly 2020-08-05 10:51:02 +02:00
Benno Schulenberg cc6d1d59a6 tweaks: optimize for byte-range characters, and shorten some comments 2020-08-05 10:12:03 +02:00
Benno Schulenberg f80ce71d13 tweaks: adjust the indentation after the previous change 2020-08-05 10:09:49 +02:00
Benno Schulenberg 2bbbd85852 tweaks: stop using a 'switch' when there are just three possibilities 2020-08-05 10:08:51 +02:00