Commit Graph

8757 Commits (02c48dc8a43da9767882d4f2d147be37f8df4049)

Author SHA1 Message Date
Benno Schulenberg 1b1d60b9d7 tweaks: drop two comments that contain variable names
Grepping for those names shouldn't find comments.  Also, the name
of the relevant boolean is clear enough to not need a comment.
2020-02-25 16:59:27 +01:00
Benno Schulenberg 9c70fdaef9 syntax: spec: drop invalid parentheses after "Summary"
Also, add the missing "RemovePathPostfixes", add extra word boundaries,
and reshuffle and regroup some things.
2020-02-25 11:47:11 +01:00
Benno Schulenberg fcbe5aedbd tweaks: use spaces when aligning things, not tabs
Also, remove a reference to the French man page that no longer exists.
2020-02-24 19:43:19 +01:00
Benno Schulenberg 6c6a3f6bd3 syntax: spec: colorize the date and author of changelog items differently
Also, remove superfluous parentheses, add missing edge-of-word markers,
correct the "ppciseries" keyword, and fold some regexes (or elements of
them) together.
2020-02-23 20:02:48 +01:00
Benno Schulenberg e873121372 syntax: spec: add two missing % signs, and colorize also "%triggerprein"
Furthermore, actually colorize the header line of a %changelog entry,
and remove two redundant fragments and simplify their overrides.
2020-02-23 19:38:54 +01:00
Neal Gompa ad52830fb8 syntax: spec: add some keywords that were added in RPM 4.15 and 4.13
In RPM 4.15, a number of new spec section features were introduced:

* %dnl                       - macro-engine level comments
* %elif, %elifos, %elifarch  - 'else if' stanzas for conditionals
* %sourcelist                - section for listing sources line by line
* %patchlist                 - section for listing patches line by line
* %generate_buildrequires    - script section after %prep for
                               generating build dependencies

(Reference: https://rpm.org/wiki/Releases/4.15.0.html.)

An enhancement added in RPM 4.13:

* Sections for file trigger stanzas

(Reference: https://rpm.org/user_doc/file_triggers.html.)

As these are being increasingly used in Fedora and other distributions,
it's quite helpful to have syntax highlighting be up to date on handling
them.

Signed-off-by: Neal Gompa <ngompa13@gmail.com>
2020-02-23 15:12:04 +01:00
Benno Schulenberg c802f91f4e tweaks: remove some unneeded braces, not used elsewhere either 2020-02-21 17:07:11 +01:00
Benno Schulenberg 51913542f4 tweaks: rename a variable, and reshuffle a declaration 2020-02-21 17:02:24 +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 1d4411a474 tweaks: elide a function call, by copying a byte directly
Now all remaining calls of measured_copy() have a "+ 1" in their
second argument, and can thus be simplified.  And each of those
calls is followed by terminating the string with a NUL byte, so
thát can be pulled into the function.
2020-02-20 16:38:14 +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
Saagar Jha 1b2a2e6737 rcfile: fix an out-of-bounds read on empty lines
Signed-off-by: Saagar Jha <saagar@saagarjha.com>

Bug existed since commit 98f038ad from a week ago.
2020-02-17 12:11:40 +01:00
Benno Schulenberg 12e5c2f07d undo: for an automatic hard-wrap, store the correct previous buffer size
The SPLIT_BEGIN item gets tucked underneath the ADD item on the top of
the undo stack.  Thus: that SPLIT_BEGIN item should copy the 'wassize'
of the ADD item instead of storing the current buffer size.

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

Bug existed since the undo functionality was added, and existed
in this form since version 2.3.5, commit be10c2a4.
2020-02-17 11:41:52 +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 a9f7277b1b tweaks: remove a now-unused helper function 2020-02-16 12:33:29 +01:00
Benno Schulenberg d13b6d6896 tweaks: elide an intermediate copy of an added character
In theory this would allow injecting more than one character at a time
into the edit buffer.  But the creation and updating of an undo item for
the addition or the deletion of a character are a bit strange.  For all
other operations and add_undo() is called before the operation, and an
update_undo() afterward.  But for an ADD, the add_undo() is called after
the operation, and for a DEL/BACK, the update_undo() is called before
the operation.  There is some logic to that, but things would be easier
to understand if all operations were handled the same: an add_undo()
beforehand (when needed), and an update_undo() afterward.
2020-02-16 12:32:10 +01:00
Benno Schulenberg 819066c5d5 tweaks: extend the undo data for deleting and backspacing more directly
To get rid of an intermediate copy of the deleted character.
2020-02-16 11:06:45 +01:00
Benno Schulenberg a65982bffb tweaks: relocate eleven functions to before they are called 2020-02-14 19:10:21 +01:00
Benno Schulenberg 6b8f446b52 tweaks: rename a constant, and rename and relocate a function 2020-02-14 19:00:16 +01:00
Benno Schulenberg 2b97d6563d tweaks: correct a typo, improve two indentations, and rewrap a line 2020-02-14 16:03:15 +01:00
Benno Schulenberg a0506a15ee undo: when undoing a paste or an insertion, remove an added magic line
When something is pasted or inserted onto the final, empty line of a
buffer, an automatic new magic line is created after it, when needed.
When this paste or insertion is undone, the added magic line should
also be removed again.

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

Bug existed since the undo capabilities were added,
since before version 2.3.0.
2020-02-14 15:27:06 +01:00
Benno Schulenberg 68ca1732b8 prompt: insert a burst of bytes in one go instead of characterwise
There is no need to count characters, so just insert the whole batch
of bytes at once.
2020-02-13 14:42:47 +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 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 f012d54a1d tweaks: make prompt-bar input more similar to edit-buffer input
In preparation for the next commit.
2020-02-12 16:59:48 +01:00
Benno Schulenberg 61dc2cab0b tweaks: rename two variables, and frob four comments 2020-02-12 16:20:20 +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 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 6cf442e329 docs: mark bracketed pasting as done in the TODO list 2020-02-11 16:59:15 +01:00
Benno Schulenberg d26f16a175 tweaks: correct two typos in a changelog, and drop a doubled word 2020-02-10 19:04:42 +01:00
Benno Schulenberg 8d7f8cda8c tweaks: improve two comments 2020-02-10 17:13:12 +01:00
Benno Schulenberg 75a70d98d5 tweaks: reshuffle two declarations plus a fragment of code
Also, don't bother statting the path that the user provided,
as that case will happen right away in the next 'if'.
2020-02-10 17:12:53 +01:00