Commit Graph

1390 Commits (ba25d0df1d0bec5f6803f8b5082e78e73299cf7a)

Author SHA1 Message Date
Benno Schulenberg ba25d0df1d tweaks: fix twenty typos, in old Changelogs and in some comments
They were found by a run of 'codespell' at https://fossies.org/.

Reported-by: Jens Schleusener <Jens.Schleusener@fossies.org>
2020-03-25 16:57:43 +01:00
Benno Schulenberg 4ce2e146ea tweaks: elide three unneeded #defines
Backspace and Tab and Carriage Return have standard backslash escapes.
2020-03-19 14:40:51 +01:00
Benno Schulenberg 415e55ff37 tweaks: move a function to before the one that calls it 2020-03-16 10:17:15 +01:00
Benno Schulenberg c20134c20d tweaks: rename a variable, away from a single letter 2020-03-16 10:15:01 +01:00
Benno Schulenberg 56308b3256 display: keep the help items aligned, by not writing too many characters
Only for the last item at the end of each of the two help lines there
are sometimes a few extra columns available.  Do not use these extra
columns also for the other help items, because apparently, when wmove()
lands in the second column of a double-width character, it does not
wipe out this character (replacing it with a space) but goes to the
next column instead, causing a misalignment of the text.

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

Bug existed since version 1.3.12, commit e806ab84.
2020-03-16 09:44:12 +01:00
Benno Schulenberg 3d8cd65b1b tweaks: reshuffle a condition, for compactness 2020-03-15 19:01:07 +01:00
Benno Schulenberg 2b6924ef6e display: do not show a "[" double-width placeholder when softwrapping
The placeholder half-duplicates the character that is actually shown
at the beginning of the next row.  When NOT softwrapping, showing a
"[" before the ">" kind of makes sense: to avoid having a gaping gap
there.  But when softwrapping, all characters of the line will be on
the screen (except when going offscreen at the bottom), so there is
no need to show a placeholder for anything.

I imagine that when reading softwrapped Chinese or Japanese text,
things are easier to understand when no characters are shown that
are not actually in the text.

This avoids https://savannah.gnu.org/bugs/?57993.

Bug existed since version 2.8.6, commit 8490f4ac.
2020-03-15 17:00:05 +01:00
Benno Schulenberg ae139021eb tweaks: rename four more functions, to get rid of an abbreviation
Also, improve their comments.
2020-03-12 15:54:19 +01:00
Benno Schulenberg 8003842e5c tweaks: rename a function, to remove an obscuring abbreviation
The "mb" made the name harder to read.  Also, the function is
not only for multibyte characters but for any character.
2020-03-12 15:53:49 +01:00
Benno Schulenberg b0eb73f7b3 feedback: make sure that a later message can overwrite a short warning
This fixes https://savannah.gnu.org/bugs/?57901.

Bug existed since version 3.0, commit 25e98776.
2020-02-26 16:41:09 +01:00
Benno Schulenberg a0703ab62d tweaks: mesh two bits of code together 2020-02-13 13:46:31 +01:00
Benno Schulenberg 9d232cd8af input: keep a multibyte character together during verbatim entry
When the user (unexpectedly) types a multibyte character after M-V,
put its first byte back into the keyboard buffer, so that the next
call of process_a_keystroke() will retrieve the byte sequence as a
whole, and will inject them as one character into the edit buffer.

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

Bug existed since version 2.6.3, commit 08c51cfd.
2020-02-13 13:15:46 +01:00
Benno Schulenberg 03d296eb35 input: allocate sufficient bytes for entering a Unicode codepoint
This fixes https://savannah.gnu.org/bugs/?57803.

Bug existed since commit 2b27df67 from yesterday.
2020-02-13 11:57:35 +01:00
Benno Schulenberg 2b27df6733 tweaks: convert integers to bytes in one place instead of two 2020-02-12 17:16:27 +01:00
Benno Schulenberg a2313f499c tweaks: move a function to after the one that it calls 2020-02-12 16:06:57 +01:00
Benno Schulenberg cbda89766f tweaks: rename a parameter and a variable, and reword two comments
Also reshuffle a declaration.
2020-02-12 16:05:18 +01:00
Benno Schulenberg 3bd66b78c1 tweaks: don't bother including Haiku escape sequences in the tiny version 2020-02-05 11:31:03 +01:00
Benno Schulenberg 5ea6054a75 tweaks: use a simple subtraction instead of a function call 2020-02-05 11:29:36 +01:00
Benno Schulenberg a2f8703df5 tweaks: tumble three conditions, for consistency in comparisons 2020-01-31 16:05:51 +01:00
Benno Schulenberg 25b0bf0ae8 tweaks: correct a couple of comments about escape sequences 2020-01-29 18:48:03 +01:00
Benno Schulenberg c64f506933 tweaks: reshuffle some declarations, and expand a few variable names 2020-01-28 10:21:34 +01:00
Benno Schulenberg fb073ec88d display: ensure the guiding stripe can be shown when not softwrapping
This fixes https://savannah.gnu.org/bugs/?57683.

Bug existed since commit 0b54785f from yesterday.
2020-01-28 09:35:45 +01:00
Benno Schulenberg 0b54785fe5 softwrap: suppress the guiding stripe on unaffected chunks
When the guiding stripe (when softwrapping) will be shown in
a later chunk, it shouldn't be shown in the current chunk.

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

Bug existed since --guidestripe was introduced, in version 4.0.
2020-01-27 15:46:57 +01:00
Benno Schulenberg 8835c0d486 tweaks: reduce the scope of a variable, and reshuffle a declaration 2020-01-27 13:36:28 +01:00
Benno Schulenberg 0442eef95b tweaks: elide a somewhat costly call by remembering some state
When having prepared a line for displaying on the screen, nano already
determind whether the line extends beyond the right edge or not.  There
is no need to calculate again the full width of the current line later.
Just let display_string() make a note whether the piece of text that
it converted to displayable form still has more text coming after it,
and use this note when it's time to show the ">" continuation sign.

Using a static variable is ugly, but passing it along as a parameter
would be even uglier, because for all other calls of display_string()
the parameter would be just a useless burden.
2020-01-27 13:23:56 +01:00
Benno Schulenberg 6ae11071b3 tweaks: add an error message for something that should never occur 2020-01-27 12:06:27 +01:00
Benno Schulenberg 3c177c1bb9 tweaks: elide a variable, and rename its sister 2020-01-26 19:23:37 +01:00
Benno Schulenberg e70ff87c86 tweaks: move another function to after the one that it calls
(The diff is stupid.  It should just remove 440 contiguous lines, and
add back 440 contiguous lines further down.  Instead it tries to find
similarities between what is moved and what remains, and makes a mess.
You have to use --patience or --minimal to get the better diff.)
2020-01-26 16:21:21 +01:00
Benno Schulenberg db10a421dc tweaks: move a function to after the one that it calls 2020-01-26 16:21:21 +01:00
Benno Schulenberg fa686457c2 input: ignore modifiers on a VT while executing a macro or a string bind
Any modifier keys that are needed to start the execution of a macro
(or of a string bind) should not affect the interpretation of the
keystrokes that are contained within the macro or the string.

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

Bug existed since macros were introduced, in version 2.9.0.
2020-01-23 12:39:23 +01:00
Benno Schulenberg 58597b6d9b tweaks: judge from the key code itself whether it is a Meta keystroke 2020-01-23 12:06:32 +01:00
Benno Schulenberg 6df50790cd input: prevent unintentional marking of text for shifted Meta keystrokes
The Shift detection on a Linux console was meant to affect only the
dedicated cursor-movement keys, not <Shift+Meta+character>.

This fixes https://savannah.gnu.org/bugs/?57598.
Indirectly-reported-by: Brand Huntsman <alpha@qzx.com>
2020-01-23 11:22:23 +01:00
Benno Schulenberg 1cd5005d06 bindings: allow to bind shifted Meta+letter combinations with Sh-M-X
As long as the user does not define any Sh-M-X bindings in their nanorc,
<Shift> and <CapsLock> will not have any effect on <Alt+letter> combos.
But as soon as any Sh-M-X combination is bound, <Shift+Alt+letter> will
be seen as different from the unshifted keystroke.

This kind of fulfills https://savannah.gnu.org/bugs/?54659.
Requested-by: Peter Passchier <peter@passchier.net>
2020-01-23 11:11:34 +01:00
Benno Schulenberg 5111b20bf5 build: exclude bracketed pasting from the tiny version 2020-01-22 12:58:48 +01:00
Benno Schulenberg 486d4956ff tweaks: elide an 'if', by moving the relevant code to a better place 2020-01-17 19:19:22 +01:00
Benno Schulenberg 7567a67cdd tweaks: elide a small function, as it's in fact needed just once 2020-01-17 19:19:04 +01:00
Benno Schulenberg c4939c76a5 tweaks: rename a function, to make it not contain the name of another
Also, improve the names of its two parameters,
and make the tiny version a wee bit smaller.
2020-01-17 17:28:48 +01:00
Benno Schulenberg 706f3e93f4 tweaks: in comments, reword "titlebar" and "statusbar" to two words each
To differentiate them from the function names.
2020-01-16 19:37:28 +01:00
Benno Schulenberg f47ef539db display: skip zero-width characters on a Linux console, to avoid a mess
This is a workaround for the VT not being able to handle zero-width
characters properly, displaying them mistakenly as visible characters.

This avoids https://savannah.gnu.org/bugs/?52954.

The problem has existed since forever, but has become noticeable
since the capability for line numbers was added in version 2.7.1.
2020-01-15 18:50:44 +01:00
Benno Schulenberg afa4c6b9fc copyright: update the years for the FSF 2020-01-15 11:42:38 +01:00
Benno Schulenberg e8d20a8e4b display: clear the help lines before a briefly shown warning
This makes the message stand out more.

Also slightly shorten the duration of the pause.
2020-01-14 10:49:12 +01:00
Benno Schulenberg 7d483987ce input: do not auto-indent when something is pasted into nano from outside
Also, do not break overlong lines and do not convert tabs to spaces,
nor interpret a <Tab> as an indent command (when the mark is on).
In other words: accept an outside paste as literally as possible.

This fulfills https://savannah.gnu.org/bugs/?40060.
Requested-by: Egmont Koblinger <egmont@gmail.com>

And fulfills https://savannah.gnu.org/bugs/?57527.
Requested-by: Sébastien Desreux <seb@h-k.fr>
Requested-by: Hans Ecke <hecke@gxt.com>

Original-idea-by: Brand Huntsman <alpha@qzx.com>
2020-01-12 11:18:51 +01:00
Brand Huntsman f705a9674b input: recognize the start and stop sequences of a bracketed paste
Also, tell the terminal to switch on bracketed-paste mode, and toggle
a boolean when the start and stop sequences of such a paste are seen.
This boolean can later be used to suppress auto-indent and such.

Signed-off-by: Brand Huntsman <alpha@qzx.com>
2020-01-12 11:18:51 +01:00
Benno Schulenberg 3233e9cfe0 tweaks: correct a comment
The maximum length was increased two weeks ago, in commit 4dcbd40c.
2020-01-12 11:18:29 +01:00
Benno Schulenberg 5b07e5fd1f input: discard partial sequences that Slang produces for F17 to F24
This fixes https://savannah.gnu.org/bugs/?57503.
2020-01-03 12:34:15 +01:00
Benno Schulenberg 1be0285832 tweaks: delete some fragments of code that have become irrelevant
Since the previous commit, USE_SLANG can only be defined when NANO_TINY
is also defined.  This means that code that is present only in non-tiny
versions does not need to cater for Slang.
2020-01-03 12:00:06 +01:00
Benno Schulenberg 5527883c43 input: don't discard the first keystroke after a resize when using Slang
With ncurses, a window resize will cause getch() to return immediately
with some dummy value, which nano can discard.  But with Slang, getch()
will return only when the next keystroke is typed, so the received code
should then not be discarded.

This fixes https://savannah.gnu.org/bugs/?57507.
2020-01-01 13:54:07 +01:00
Benno Schulenberg 84b305f3f0 build: exclude the escape sequences for F13...F16 from the tiny version
The F13 to F16 function keys are no longer bound by default, and when
there is no nanorc file, there is no way to bind them, so there is no
point in recognizing their escape sequences.
2019-12-30 11:55:41 +01:00
Benno Schulenberg 6d916c6c4a tweaks: rewrap a comment and a line, and reshuffle a fragment of code 2019-12-29 14:13:27 +01:00
Benno Schulenberg 87542eeaf1 tweaks: move a function to before the one that calls it
And condense its logic.  And improve its comment.
2019-12-27 17:01:15 +01:00