Commit Graph

8039 Commits (1075de1222e90c03020a0b2e19ca22737c201740)

Author SHA1 Message Date
Benno Schulenberg c55d144748 tweaks: drop most of the remaining debugging code, and some timing code 2019-05-08 15:23:36 +02:00
Benno Schulenberg da91a44f9e tweaks: reshuffle two #ifdefs, to avoid an unpaired brace 2019-05-08 13:56:02 +02:00
Benno Schulenberg 02d3a2c0fb tweaks: remove some unneeded braces, and reshuffle for more symmetry 2019-05-06 11:20:31 +02:00
Benno Schulenberg 5764619655 search: stay in the Search menu when trying to Replace in view mode
This fixes https://savannah.gnu.org/bugs/?56274.

Bug existed since version 3.1, commit 6cd53e7f.
2019-05-06 11:08:22 +02:00
Benno Schulenberg 3c959fd038 tweaks: drop a useless tidying-up call, as spelling does not use regexes
The integrated spell checker does not use regular expressions, and
'refresh_needed' is set to TRUE anyway, so the tidy_up_after_search()
call there is effectively a no-op.
2019-05-06 10:57:45 +02:00
Benno Schulenberg f0bc94fd02 tweaks: move the tyding-up-after-a-search to a single exit point 2019-05-06 10:29:45 +02:00
Benno Schulenberg 8720cfcce9 tweaks: rename two more functions, to be simpler too 2019-05-04 11:21:45 +02:00
Benno Schulenberg 954c4d03ac tweaks: rename two functions, to be simpler 2019-05-04 11:21:45 +02:00
Benno Schulenberg edf6995be4 zapping: use the 'keep_cutbuffer' logic to keep undo items apart
The 'keep_cutbuffer' variable becomes FALSE whenever there is cursor
movement or there was a marked region.  Use this variable to simplify
the condition for creating a new ZAP undo item.  But then typing the
'zap' shortcut should not cause the variable to be set to FALSE.

This fixes the first part of https://savannah.gnu.org/bugs/?56261.

Bug existed since zapping was introduced, in version 3.2.
2019-05-04 11:18:51 +02:00
Benno Schulenberg b50d5758ef zapping: disjoin a zap command from earlier ones when the mark is set
This fixes the third part of https://savannah.gnu.org/bugs/?56261.

Bug existed since zapping was introduced, in version 3.2.
2019-05-03 12:58:17 +02:00
Benno Schulenberg 6c4d0d87f0 tweaks: remove a condition that has become superfluous
After the previous change, a copy command will break a chain of cut
commands, so there is no need any more to verify that the line number
hasn't changed.
2019-05-03 12:41:49 +02:00
Benno Schulenberg a962bceca6 copying: let a copy command break a chain of cut or zap commands
This fixes the second part of https://savannah.gnu.org/bugs/?56261.

Bug existed since zapping was introduced, in version 3.2.
2019-05-03 12:33:42 +02:00
Benno Schulenberg e0c5c589ad tweaks: remove a superfluous condition, in three places
When 'last_action' has a specific value, then necessarily there must
exist a corresponding current undo item.

(The condition is already absent in do_deletion(), for the BACK and DEL
undo items, and it works fine there.)
2019-05-03 12:18:04 +02:00
Benno Schulenberg dfe87540c6 syntax: po: colorize also escaped hex and octal codes 2019-05-03 12:12:44 +02:00
Benno Schulenberg 6c4f228f6f tweaks: invert two conditions, in order to elide an extra variable 2019-05-02 14:34:05 +02:00
Benno Schulenberg fe06ae5f48 tweaks: normalize the indentation after the previous two changes 2019-05-02 14:27:35 +02:00
Benno Schulenberg 07289f437f tweaks: invert a condition, in order to return earlier 2019-05-02 14:12:23 +02:00
Benno Schulenberg 99d155d80f tweaks: reshuffle an assignment, to be able to return earlier 2019-05-02 14:10:23 +02:00
Benno Schulenberg 3346c5395e tweaks: place a function better, and reduce some comments to a single one 2019-05-02 10:17:10 +02:00
Benno Schulenberg 083218aca5 tweaks: rename two parameters, to differentiate them from function names 2019-05-02 10:17:04 +02:00
Benno Schulenberg fd3b3bc1d6 cutting: clear the cutbuffer when the previous operation was copying
The cut and copy operations (^K and M-6) are different operations and
one should not add to the cutbuffer created by the other.

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

Bug existed since version 3.0, commit 71f85937.
2019-05-02 09:27:37 +02:00
Benno Schulenberg 9bc6bc83c0 tweaks: rename two variables, for more contrast 2019-05-01 19:14:06 +02:00
Benno Schulenberg d4468b2def tweaks: condense a comment and reshuffle a couple of lines 2019-05-01 19:10:56 +02:00
Benno Schulenberg 404a6862cd tweaks: really don't bother renumbering the lines in the cutbuffer
The lines from the cutbuffer will be renumbered when it matters: when
they get pasted.

The only place that used the numbering of (a copy of) the cutbuffer
(the updating of an undo item) already iterates through its lines.
Just add a counter there instead of making use of the line numbers.
2019-05-01 13:09:22 +02:00
Benno Schulenberg 85fc41470b tweaks: stop passing 'cutbuffer' and 'cutbottom' back and forth
All extractions are done into the cutbuffer, so it is pointless to pass
'cutbuffer' and 'cutbottom' in and back out as parameters all the time.
Just use those global variables directly.

Also, rename the function as there is no longer a buffer among its
parameters.
2019-05-01 11:33:37 +02:00
Benno Schulenberg 2b9dd6c574 tweaks: don't bother saving and restoring 'cutbottom' all the time
The 'cutbottom' variable is only ever used when cutting or copying
consecutive lines: for appending the current line to the already
existing lines in the cutbuffer.  As soon as some other operation
is performed, 'cutbottom' becomes irrelevant, it could be set to
anything, it doesn't matter: the pasting of the cutbuffer does not
use the value of 'cutbottom', nor does any other operation.
2019-05-01 11:19:14 +02:00
Benno Schulenberg 9e44a53be7 copying: scroll just one line when M-6 is pressed on the bottom row
This fixes https://savannah.gnu.org/bugs/?56249.

Bug existed since version 2.6.0, commit 318ed6b1.
2019-04-30 19:31:44 +02:00
Benno Schulenberg 0c561f0325 copying: make M-6 do nothing when at end of buffer 2019-04-30 19:03:18 +02:00
Benno Schulenberg e5831f81bb tweaks: rename two variables, to be less cryptic 2019-04-30 18:41:05 +02:00
Benno Schulenberg fa21986ecf oops: apparently the line numbers in the cutbuffer do matter
The line numbers don't matter for the cutbuffer itself, but they matter
for the copy of the cutbuffer that is stored in an undo item.

This reverts commit 14140d52 from two hours ago.

This fixes https://savannah.gnu.org/bugs/?56245.
2019-04-30 12:49:57 +02:00
Benno Schulenberg 772137cabe tweaks: rename a variable, to fit a bit better 2019-04-30 12:24:56 +02:00
Benno Schulenberg 4c53e2f56b tweaks: elide two unneeded variables
After extracting a line or region, the current line is always the one
where renumbering should start.  And when ingrafting a buffer, it is
always the first ingrafted line where renumbering should start.  The
'top_save' variable was indirectly getting set to those lines.

Also, renumber immediately after unpartitioning the file buffer, before
doing anything else.
2019-04-30 12:20:41 +02:00
Benno Schulenberg 14140d5249 tweaks: don't bother renumbering the lines in the cutbuffer
The numbering of the lines in the cutbuffer is irrelevant.  These lines
will be renumbered when it matters: when they get pasted.
2019-04-30 10:55:15 +02:00
Benno Schulenberg 17aa9371b5 tweaks: rename a function, to better indicate what it does 2019-04-30 10:27:10 +02:00
Benno Schulenberg 208995e4a7 tweaks: move a bit of timing code to where it will be needed 2019-04-30 10:15:46 +02:00
Benno Schulenberg b503670750 tweaks: rename a variable, to match another with the same meaning
Also, remove a redundant condition.
2019-04-30 10:15:11 +02:00
Benno Schulenberg 7c08e8ea69 cutting: ignore the mark when a word is deleted
Just like for deleting a word to the left, the mark should be ignored
also when deleting a word to the right.

This fixes https://savannah.gnu.org/bugs/?56241.
2019-04-30 09:53:10 +02:00
Benno Schulenberg 542426f1f1 tweaks: add a warning for something that shouldn't occur 2019-04-30 09:44:47 +02:00
Benno Schulenberg 6319a86178 tweaks: improve some comments, reshuffle a line, and rename a variable 2019-04-29 11:08:21 +02:00
Benno Schulenberg 9888e67b20 tweaks: rename two variables, for more contrast with the partition stuff 2019-04-29 09:45:41 +02:00
Benno Schulenberg 8fe19e344f tweaks: use a more direct call when a single linestruct is deleted 2019-04-28 17:20:08 +02:00
Benno Schulenberg 896cfcef95 tweaks: when OR'ing, put the most likely condition first
Also, slightly reword a comment, adjust some whitespace, and use
a more direct comparison for equality.
2019-04-28 15:53:33 +02:00
Benno Schulenberg d54180ad8b tweaks: reduce a bit of mark-adjusting code to its essence
It doesn't matter whether the grafted text contains a newline or not.

It only matters whether the mark was before or after the cursor.  When
it was after the cursor, the mark needs to be set to the bottom line of
the grafted text and its x coordinate needs adjustment; and when it was
before the cursor, the mark just needs to be set to the top line of the
grafted text.
2019-04-28 12:18:24 +02:00
Benno Schulenberg 065afe6e0f tweaks: reshuffle a bit of code, to be less intertwined 2019-04-28 11:54:23 +02:00
Benno Schulenberg 37eccd3117 tweaks: rename a function, to be more fitting
Also, adjust some whitespace, for esthetics.
2019-04-28 11:01:51 +02:00
Benno Schulenberg b9dd572a67 tweaks: set a boolean directly, instead of using a function call 2019-04-28 10:40:37 +02:00
Benno Schulenberg 3fe17e0355 docs: adjust the wording of the README to be factually correct
That is: don't say that nano doesn't change the file contents by default.

Also, correct the style of the preceding paragraph.
2019-04-28 10:35:27 +02:00
Benno Schulenberg 6e3a3964ce tweaks: adjust the indentation after the previous change
Also, condense a couple of comments.
2019-04-27 17:17:06 +02:00
Benno Schulenberg 18eb7e6d21 tweaks: elide an unneeded 'if' and 'break' 2019-04-27 17:10:10 +02:00
Benno Schulenberg e84a790b5d tweaks: rename a variable, to better indicate it contains two characters
Also rename a function, to differentiate it more from do_find_bracket().
2019-04-27 17:01:34 +02:00