Commit Graph

1396 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 481529e865 input: accommodate silly emulators that have LF instead of CR in a paste
Even though a user would never type ^J to start a new line, accept it
as a synonym of <Enter> (^M) in a bracketed paste, because apparently
bash accepts it as a synonym too.

This works around https://savannah.gnu.org/bugs/?58010.
2020-03-20 14:25:27 +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 ea95ad24be usage: improve the description of --softwrap
Concisely say what the option actually does.
2020-03-17 09:51:03 +01:00
Benno Schulenberg 02efc760bf tweaks: rename a symbol, to match the corresponding renamed option 2020-03-13 16:17:10 +01:00
Benno Schulenberg 9a59cddcd4 options: rename --suspend to --suspendable, to make more sense 2020-03-13 15:54:24 +01:00
Benno Schulenberg ebf9279f95 tweaks: rename two more functions, to match the style of others 2020-03-11 19:47:21 +01:00
Benno Schulenberg 304548ef82 tweaks: rename two functions, to match the style of others 2020-03-11 19:45:06 +01:00
Benno Schulenberg dd6f129c3c tweaks: rename two functions, for shortness 2020-03-11 19:43:03 +01:00
Benno Schulenberg 750b51c343 copyright: update to the current year for significantly changed files 2020-03-11 11:52:15 +01:00
Benno Schulenberg 843dbd56ef tweaks: rename two more elements of an undo record, for symmetry
(Note that for a PASTE and a COUPLE_END the variables seem to be used
the wrong way around.  Maybe this can be improved.)
2020-02-27 10:08:48 +01:00
Benno Schulenberg be7e000389 tweaks: pull the NUL-terminating of a string into a function
Also, avoid copying one byte too many that afterward gets
overwritten with '\0'.
2020-02-20 17:08:32 +01:00
Benno Schulenberg 76f1a4af4f tweaks: add a different helping variable 2020-02-19 19:06:04 +01:00
Benno Schulenberg bb1a0bd86c input: after reallocating a string, do not write to its old address
The old address has become invalid, and probably does not have enough
room for the write, thus causing a crash.

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

Bug existed since commit 8625609c from two days ago.
2020-02-19 18:54:01 +01:00
Benno Schulenberg 8b2b9654ab tweaks: condense a comment, reshuffle conditions, and remove unwanted one 2020-02-18 16:26:56 +01:00
Benno Schulenberg 60ae71bf3a softwrap: when typing goes beyond the bottom row, scroll just one row
This fixes https://savannah.gnu.org/bugs/?57851.

Bug existed since version 2.8.0, when scrolling per soft-wrapped chunk
was made possible.
2020-02-18 15:42:20 +01:00
Benno Schulenberg 8625609c2d tweaks: rename a variable, and add a helping one 2020-02-18 15:00:27 +01:00
Benno Schulenberg 3c4a4b04ce tweaks: normalize the indentation after the previous change
Also rewrap two lines, reshuffle three, and improve three comments.
2020-02-18 14:58:06 +01:00
Benno Schulenberg b3faf353c9 tweaks: inject the entire burst of bytes at once into the edit buffer
Not doing it characterwise saves a reallocation, a memmove(), several
checks, and an update_undo() for each character over one.

This has been tested by temporarily setting 'bracketed_paste = FALSE'
instead of 'bracketed_paste = TRUE' in convert_sequence() in winio.c,
and then pasting stuff into nano.
2020-02-18 14:54:19 +01:00
Benno Schulenberg f700b422be tweaks: call add_undo() before the character is actually added
And before the buffer size is adjusted, so that the add_undo()
doesn't need to correct the stored former size of the buffer.

This will allow the injection of multiple characters at once,
in the next commit.
2020-02-18 14:40:15 +01:00
Benno Schulenberg 5c07a747bb tweaks: adjust some whitespace, reshuffle two ifs, and remove two braces 2020-02-17 11:29:13 +01:00
Benno Schulenberg 75f4309c1f tweaks: rename four parameters, to be more distinct and telling 2020-02-13 14:22:40 +01:00
Benno Schulenberg 78767b583d tweaks: elide an intermediate copy of a character during injection, twice 2020-02-13 14:22:23 +01:00
Benno Schulenberg 61dc2cab0b tweaks: rename two variables, and frob four comments 2020-02-12 16:20:20 +01:00
Benno Schulenberg 070ccf4a5b tweaks: rename two variables, and reshuffle a few things 2020-02-12 14:28:07 +01:00
Benno Schulenberg 8e4b68917c tweaks: rename a function, and condense a few comments 2020-02-12 14:15:35 +01:00
Benno Schulenberg 0d0d011579 tweaks: combine two ifs into one 2020-02-12 12:09:12 +01:00
Benno Schulenberg 71daa1ef6b tweaks: update several comments after the previous changes 2020-02-12 12:05:52 +01:00
Benno Schulenberg 0ed62e84de tweaks: weld two fragments together, twice, by eliding an unneeded 'if'
The get_kbinput() routine will never return ERR, so there is no need
to check for that.
2020-02-12 11:46:15 +01:00
Benno Schulenberg 0a31a9aa38 tweaks: make two conditions more direct, and thus elide two functions
Using straightforward comparisons is clearer and faster and shorter.

Again, note that this does not filter out 0x7F (DEL).  But that is
okay, as that code will never be returned from get_kbinput().
2020-02-12 11:38:33 +01:00
Benno Schulenberg 6747142cd7 tweaks: remove some redundant filtering, and thus elide a parameter
The few calls of the injection routines that had 'filtering' set to
TRUE have already filtered out ASCII control codes earlier on.  And
in the case of injecting a completion, this completion only contains
word-forming characters -- and if the user somehow added a control
code to the word-forming characters, then nano should NOT filter it
out, so in fact that setting of 'filtering' to TRUE was mistaken.

Note that this filtering did not filter out 0x7F (DEL).  But that is
fine: it should not occur in the input stream at that point anyway,
as it gets translated to either KEY_DC or KEY_BACKSPACE earlier in
the keyboard parsing routines.
2020-02-12 11:12:34 +01:00
Benno Schulenberg cbeea859c2 shutdown: don't refer to an open file when there aren't any
This fixes https://savannah.gnu.org/bugs/?57780.

Bug existed since commit b63c90bf from yesterday.
2020-02-10 09:28:37 +01:00
Benno Schulenberg 7ce1f6d86d locking: when finding a lock file at startup, quit when user cancels
When at startup the user presses Cancel at the "open anyway?" prompt,
cancel the whole startup: quit.  But when the user answers No, just
skip the file and continue starting up.
2020-02-02 13:00:37 +01:00
Benno Schulenberg a2f8703df5 tweaks: tumble three conditions, for consistency in comparisons 2020-01-31 16:05:51 +01:00
Benno Schulenberg a692b01c04 tweaks: reshuffle two lines, to do the linking first, then the content 2020-01-29 12:33:30 +01:00
Benno Schulenberg a197ccf12d tweaks: move another function, to group the deleting ones together 2020-01-29 12:16:09 +01:00
Benno Schulenberg 67e5913edf tweaks: move another function to before the one that calls it 2020-01-29 10:54:30 +01:00
Benno Schulenberg e864107046 tweaks: move a function to right before the one that calls it 2020-01-29 10:53:05 +01:00
Benno Schulenberg 7984ea4eb6 tweaks: remove two superfluous assignments, and rename a variable
The 'prev' and 'next' links get assigned to immediately after the
call of copy_node().  And anyway, it does not make sense to link
a copied node to the predecessor and successor of its original.

Also slightly regroup some lines.
2020-01-29 10:47:09 +01:00
Benno Schulenberg f38bd5030d tweaks: add a little change that was overlooked in the previous commit
Option --showcursor applies also to the help viewer, which means that
it can do something useful in restricted mode too.
2020-01-28 12:00:05 +01:00
Benno Schulenberg a2fea9928d build: exclude option '-g' when configured without browser and help 2020-01-28 10:33:56 +01:00
Benno Schulenberg 445cd2a6c5 usage: improve the description of --restricted and --quickblank
Give a little more information than just a rehash of the long option.
2020-01-28 10:04:01 +01:00
Benno Schulenberg c09e96f294 suspension: put in an extra terminal-initialization call for Slang
Also, the disabling of the keyboard interrupt (SIGINT) must happen
after that initialization call, otherwise ^C will still do nothing
after returning from suspension (when nano is built against Slang).

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

Bug existed since version 2.2.0, commit daaf468c.
2020-01-27 16:46:01 +01:00
Benno Schulenberg f8553f6d3a feedback: restore a message that can occur in help viewer or file browser
It was mistakenly removed in commit ea874112, two days ago.
2020-01-24 19:45:07 +01:00
Benno Schulenberg d764d7094f tweaks: don't enable bracketed pasting when not handling such pastes
The tiny version is oblivious of bracketed pastes, as it serves no
purpose: in the tiny version there is no auto-indent nor undo nor
tabs-to-spaces conversion.
2020-01-24 17:21:47 +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 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 ea874112d8 tweaks: remove a feedback message that is never shown
A plain printable ASCII character (from 0x20 to 0x7E) can never be
a shortcut, so it also can never get reported as being unbound.
2020-01-22 15:41:04 +01:00
Benno Schulenberg 25d397e7b3 feedback: report Ctrl+Alt keystrokes as unbindable
When reporting them as simply unbound, the user might think that M-^X
keystrokes might somehow become bound.
2020-01-22 15:10:41 +01:00
Benno Schulenberg 5111b20bf5 build: exclude bracketed pasting from the tiny version 2020-01-22 12:58:48 +01:00