Benno Schulenberg
c65fa25ce2
docs: mention that ^[ (Esc) is unbindable, and explain why
2020-03-10 15:55:19 +01:00
Benno Schulenberg
cbbfebbc7a
bindings: remove the translation of ^H to Backspace on the BSDs
...
This avoids an unintended rebinding of the <Backspace> key
on terminal emulators.
This fixes https://savannah.gnu.org/bugs/?57981 .
Reported-by: Ciprian Tomoiaga <ciprian.tomoiaga@gmail.com>.
2020-03-10 14:28:55 +01:00
Benno Schulenberg
9d499c769b
justify: do not take an empty line as template for first-line indentation
...
This fixes https://savannah.gnu.org/bugs/?57437 .
2020-03-10 10:56:05 +01:00
Benno Schulenberg
dad2b5541e
tweaks: rename a variable, for aptness
2020-03-10 10:50:27 +01:00
Benno Schulenberg
56960ce05e
tweaks: reshuffle some stuff, to have related things together
...
Also for compactness, and not to use 'lead_len' for two purposes.
2020-03-10 10:45:46 +01:00
Benno Schulenberg
e247be69bf
justify: when the cursor is at the left edge, keep it there
...
Only when the endpoint of the selection is actually IN a leading part,
then it should be advanced to include the whole leading part, so that
the succeeding paragraph will get the proper first-line indentation.
2020-03-10 10:32:21 +01:00
Benno Schulenberg
e209686835
justify: give the first line of a marked region its proper indentation
...
When justifying a selection from the middle of a paragraph, the first
line of both that selection and of the new paragraph after it should
get the same indentation as the first line of the original paragraph.
This fulfills https://savannah.gnu.org/bugs/?56308 .
2020-03-10 10:29:49 +01:00
Benno Schulenberg
047936c338
tweaks: reshuffle an assignment and a free()
2020-03-09 14:28:57 +01:00
Benno Schulenberg
ca0571ea52
tweaks: remove an unneeded indirection
...
The concatenating function does not change the passed linestruct.
The data yes, but not the linestruct itself.
2020-03-09 14:25:41 +01:00
Benno Schulenberg
655cf9573f
tweaks: always determine the second lead, to simplify the rewrap call
...
Also rename some variables.
2020-03-09 14:11:47 +01:00
Benno Schulenberg
c457f744ef
justify: trim the leading blanks of a marked region at the right moment
...
This fixes https://savannah.gnu.org/bugs/?57977 .
Bug existed since commit 5310a355
from three hours ago.
2020-03-09 14:05:18 +01:00
Benno Schulenberg
8f3ea23ece
tweaks: rename a variable, to not be a substring of a function name
2020-03-09 12:31:10 +01:00
Benno Schulenberg
3225c71ecd
justify: when appropriate, move end point of marked region forward
...
So that also the line after the newly made paragraph gets the
leading part that belongs to the start of a new paragraph.
This https://savannah.gnu.org/bugs/?57974 .
Bug existed since version 4.0, since the justifying
of a marked region was introduced.
2020-03-09 12:15:01 +01:00
Benno Schulenberg
5310a355ef
tweaks: reshuffle the trimming of leading whitespace, for compactness
2020-03-09 11:43:50 +01:00
Benno Schulenberg
d7875cdf4f
tweaks: when appropriate, move starting point of justified region back
...
This makes things simpler, so that I can understand them.
2020-03-09 11:33:16 +01:00
Benno Schulenberg
dc05defb8a
tweaks: rename four variables, to be a bit more telling
2020-03-09 11:10:07 +01:00
Benno Schulenberg
98c11d0a82
tweaks: reshuffle some code, in preparation for improving it
2020-03-09 11:09:56 +01:00
Benno Schulenberg
14f1652842
tweaks: move a function to its proper place in the order of things
2020-03-09 09:44:43 +01:00
Benno Schulenberg
d4b97a08cd
tweaks: elide a variable and an unneeded iteration
2020-03-08 16:55:02 +01:00
Benno Schulenberg
c934c1d71b
justify: trim prefixed whitespace when justifying a marked region
...
This fixes https://savannah.gnu.org/bugs/?56307 .
Bug existed since version 4.0, when the justifying
of a marked region was introduced.
2020-03-08 16:18:34 +01:00
Benno Schulenberg
a16315a65f
tweaks: remove a redundant statement, a spurious reference to 'cutbottom'
...
This assignment should have been removed in commit f5ac8c1e
from
six years ago, as it became superfluous then. Later changes made
'cutbottom' become valid only when something had actually been cut.
2020-03-08 15:50:55 +01:00
Benno Schulenberg
d6beca5dcf
justify: do not copy too many bytes when trimming leading whitespace
...
This fixes https://savannah.gnu.org/bugs/?57972 .
Bug existed since version 4.0, commit 877a6498
.
2020-03-08 15:09:40 +01:00
Benno Schulenberg
9d7e62be1a
tweaks: rename two variables, to be different or for more contrast
...
Also, invert the logic of the second.
2020-03-08 14:12:45 +01:00
Benno Schulenberg
5c008726f0
tweaks: rename two variables, to harmonize with two others
2020-03-08 14:04:29 +01:00
Benno Schulenberg
8c506d86af
tweaks: rename two variables, to suit both the marked and unmarked case
2020-03-08 13:57:04 +01:00
Benno Schulenberg
db7a49edc6
tweaks: create an undo item earlier, and discard it when needed
...
This avoids having to temporariyly store and then later fill in
the original cursor position.
2020-03-08 13:40:38 +01:00
Benno Schulenberg
2428c5cbe6
tweaks: strip a parameter that is equivalent to 'openfile' for both calls
2020-03-08 12:54:47 +01:00
Benno Schulenberg
01bc0148c0
tweaks: strip a parameter that is TRUE for both calls
...
The parameter has been redundant since version 4.0, commit d54840c1
,
when the last call with FALSE was removed.
2020-03-08 12:48:41 +01:00
Benno Schulenberg
a92511ceaf
tweaks: move another function to where it is used
2020-03-06 18:52:42 +01:00
Benno Schulenberg
19517fc51e
tweaks: elide a parameter, and rename a variable
2020-03-06 17:06:14 +01:00
Benno Schulenberg
71c35d3ca2
tweaks: move a function to where it is used
2020-03-06 17:00:31 +01:00
Benno Schulenberg
38af812a82
tweaks: reshuffle the setting of the starting point of a cut
2020-03-06 16:57:22 +01:00
Benno Schulenberg
622111613f
tweaks: elide two variables and their two assignments
...
Also reshuffle two declarations, and confine the swapping of
the endpoints of a backward-marked region to a smaller scope.
2020-03-06 12:49:06 +01:00
Benno Schulenberg
21ef05058c
tweaks: add a COUPLE_END undo item a bit later, instead of updating it
2020-03-06 12:30:24 +01:00
Benno Schulenberg
abcdd6605c
tweaks: reshuffle a condition, for compacter code
2020-03-05 19:37:09 +01:00
Benno Schulenberg
f2d89cb3bc
justify: restore a region properly when it was marked backwards
...
This fixes https://savannah.gnu.org/bugs/?57960 .
Bug existed since version 4.8, commit e01651cd
.
2020-03-05 18:46:37 +01:00
Benno Schulenberg
2d05ce37c6
justify: do not crash when the user attempts to justify an empty region
...
This fixes https://savannah.gnu.org/bugs/?57959 .
Bug existed since version 4.0, since the justifying
of a marked region was introduced.
2020-03-05 16:57:16 +01:00
Benno Schulenberg
2bc5c1987c
tweaks: factor out a three-line condition into a separate function
...
For clarity.
2020-03-05 16:09:56 +01:00
Benno Schulenberg
e39e2ddf52
tweaks: add a supporting variable, in order to condense some statements
2020-03-05 16:07:52 +01:00
Benno Schulenberg
ac61254581
tweaks: invert the logic of a symbol, to make more sense
...
Giving a name to the uncommon case is more fitting.
It also avoids a negation and allows to elide a condition.
2020-03-05 15:12:08 +01:00
Benno Schulenberg
9e182fde66
tweaks: swap the use of 'head' and 'tail' for CUT and PASTE undo items
...
Now the 'head' endpoint is closer to the top of the buffer, and the
'tail' endpoint closer to the bottom. That makes more sense.
2020-03-05 14:52:02 +01:00
Benno Schulenberg
70d59ffe16
tweaks: remove a redundant assignment
...
Consecutive additions all happen on the same line. When automatic
hard-wrapping occurs, the ADD item is grouped together with an ENTER
item, and subsequent additions go into a new ADD item.
2020-03-05 13:32:20 +01:00
Benno Schulenberg
fb4bcd8cfd
undo: store the cursor row, for redoing filtering & justification better
...
This fixes https://savannah.gnu.org/bugs/?57958 .
2020-03-05 12:34:55 +01:00
Benno Schulenberg
2288abcd49
tweaks: use the variable that suits 'END' better
2020-03-05 12:34:17 +01:00
Benno Schulenberg
42fde1cbc6
tweaks: improve four comments, and condense two fragments of code
2020-03-04 16:45:26 +01:00
Benno Schulenberg
d675a549de
rcfile: don't store a coloring rule before it is complete
...
This really fixes https://savannah.gnu.org/bugs/?57950 .
2020-03-04 16:08:34 +01:00
Benno Schulenberg
6bab8d19c6
tweaks: adjust the indentation after the previous change
...
And regroup things a bit.
2020-03-03 19:46:46 +01:00
Benno Schulenberg
365058c48f
rcfile: when a start= is not matched with an end=, abandon the whole rule
...
This fixes https://savannah.gnu.org/bugs/?57950 .
Bug existed since before version 2.2.0.
2020-03-03 19:42:40 +01:00
Benno Schulenberg
5eb7145939
rcfile: do not allow a regex for name, header, or magic to be empty
...
If the user really wants to match anything, ".*" should be used.
(This also stops nano looking at the rest of the line as soon as an
empty regular expression is encountered. This may seem like poorer
feedback than before, but... I think that multiple error messages
per line are more confusing than helpful.)
This fixes https://savannah.gnu.org/bugs/?57942 .
Bug existed since before version 2.2.0.
2020-03-03 19:21:08 +01:00
Benno Schulenberg
4dab491df2
tweaks: improve three comments, and reshuffle two declarations
2020-03-03 16:42:40 +01:00