Commit Graph

7659 Commits (b5ca8a00afb9195c6355ca45e4b70ff9bc01f25f)

Author SHA1 Message Date
Benno Schulenberg a57c6a6763 tweaks: elide a one-line function that is used just twice 2018-12-27 21:19:47 +01:00
Benno Schulenberg 597d90207e startup: improve two error messages by mentioning the invalid operand
This addresses https://savannah.gnu.org/bugs/?55304.
2018-12-27 21:08:57 +01:00
Benno Schulenberg b1b2369541 tweaks: rewrap a line and improve a few comments 2018-12-26 15:11:20 +01:00
Benno Schulenberg 8a88cea256 tweaks: elide a variable that is a copy of another 2018-12-26 14:56:29 +01:00
Benno Schulenberg 6f23d9c18c tweaks: rename a variable, because it also serves as "last line" 2018-12-26 14:37:36 +01:00
Benno Schulenberg dfbffff4b0 tweaks: remove a superfluous incrementing and decrementing of a variable 2018-12-26 14:28:54 +01:00
Benno Schulenberg ea73d7fd70 tweaks: condense a couple of comments and rewrap a few lines 2018-12-26 14:26:54 +01:00
Benno Schulenberg 55c52c50d0 bindings: hard-bind ASCII code 0x08 (BS) to the backspace function
ASCII code BS should always do a backspace, also on systems where the
"^H" string gets redirected (for rebinding purposes) to KEY_BACKSPACE.

This fixes https://savannah.gnu.org/bugs/?55247.
Reported-by: Norton Warner <nortonwarner@gmail.com>
2018-12-23 18:45:12 +01:00
David Lawrence Ramsey 77bd8c2630 tweaks: swap the names of the variables 'wrap_at' and 'fill'
Now 'fill' contains the original specified value,
and 'wrap_at' the column that 'fill' translates to.
2018-12-18 19:50:59 +01:00
Benno Schulenberg 3121ee4b2e options: stop recognizing and mentioning --quiet and 'set quiet'
Those options have been a no-op and obsolete for over a year.

Just continue to accept and ignore -q, for some "compatibility"
with Pico.
2018-12-18 19:29:40 +01:00
Benno Schulenberg 762cee242a tweaks: reshuffle a bit of code, to have the exit point near the end 2018-12-18 19:27:17 +01:00
Benno Schulenberg 3a170d2c3e rcfile: when rebound, DO unbind a keystroke from its earlier function
When not unbinding it from its earlier function (in the same menu),
it would result in showing the keystroke twice in the help text.

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

Bug was introduced a month ago, by commit f81d174f.
2018-12-18 19:25:33 +01:00
Benno Schulenberg e8751d1d5c bindings: make the normal scrolling keystrokes work also in help viewer
There is no reason why they shouldn't work.
2018-12-17 17:05:56 +01:00
Benno Schulenberg 9dd6407bea docs: correct the descriptions of 'speller' and 'linter' functions
Since the last release, the linter function is bound separately and
no longer masks or overrides the speller function.
2018-12-17 16:05:35 +01:00
Benno Schulenberg 670dd9bbe0 tweaks: condense two regexes in the Tcl syntax, and add a comment
Also, make a range of characters more explicit.
2018-12-17 16:00:54 +01:00
Benno Schulenberg 9cdc64c97a syntax: tcl: colorize comments normally, not with a background hue
This makes for a less "messy" and more readable appearance.

Suggested-by: Michael Siegel <msi@malbolge.net>
2018-12-17 15:35:56 +01:00
Benno Schulenberg 5acfa5bb7b tweaks: slightly indent warnings and errors during the configure phase
To make them stand out in the waterfall of messages.
2018-12-16 14:41:31 +01:00
Benno Schulenberg 38ca2a41f4 tweaks: reduce the scope of two variables, and rename one of them
Also, swap the order of the 'if', and don't bother setting a freed
string pointer to NULL as it will never be used again.
2018-12-11 10:59:12 +01:00
David Lawrence Ramsey 6e3b9ac058 options: exit on a bad quoting regex, instead of crashing later
The paragraph-jumping functions used the regex unverified...

This fixes https://savannah.gnu.org/bugs/?55169.
2018-12-11 10:29:29 +01:00
Benno Schulenberg 41c561c5cf tweaks: schedule a call of edit_refresh() instead calling it directly
The direct call was a leftover of the old unjustify mechanism.

Also, move two statements to the end of the do_justify() routine,
since that is their place in comparable routines.

Suggested-by: David Lawrence Ramsey <pooka109@gmail.com>
2018-12-10 17:38:39 +01:00
Benno Schulenberg c0abcc6018 docs: harmonize the style of bindable-function descriptions 2018-12-10 11:57:14 +01:00
Benno Schulenberg 55537dc218 display: show it in title bar when starting up in restricted mode 2018-12-03 12:33:00 +01:00
Benno Schulenberg 3a79766da6 rcfile, docs: remove deprecated forms of two options and five bindables
This addresses https://savannah.gnu.org/bugs/?53785.
2018-12-03 10:25:55 +01:00
Benno Schulenberg 0f79a42333 browser: say "Close" instead of "Exit" for the ^X shortcut
When multiple buffers are open, the edit window says "Close" for ^X
instead of "Exit" (when one buffer is open).  In the help viewer ^X
says "Close".  Apparently the idea is that ^X should say "Exit" only
when pressing ^X leads to exiting from nano.  Pressing ^X in the file
browser does not exit from nano, so make it say "Close" instead.

(The help viewer says "Close" since version 2.8.6, commit 934a2192.)
2018-12-03 10:07:42 +01:00
Benno Schulenberg 3b79c7168e help: don't advertise ^S and ^Q when --preserve is used
When using --preserve, ^S and ^Q are "eaten" by the terminal and
do not reach nano: they have no effect in nano, so the help lines
and the help texts should not mention these shortcuts.

Also, to keep the help lines in the help viewer neatly arranged,
^L is not bound there when --preserve is used.
2018-12-03 09:50:00 +01:00
Benno Schulenberg a9b4430888 docs: update the links in the FAQ to the mailing-list info pages
This fixes https://savannah.gnu.org/bugs/?55129.
Reported-by: Peter Passchier <peter@passchier.net>
2018-12-02 20:05:32 +01:00
Benno Schulenberg 7ca20711a2 build: verify that 'pkg.m4' is available when building from git
This addresses https://savannah.gnu.org/bugs/?44630.
Reported-by: Peter Passchier <peter@passchier.net>
2018-11-29 19:40:54 +01:00
Benno Schulenberg cad8493e24 tweaks: move the checks for git and gettext to a far earlier point 2018-11-29 19:36:51 +01:00
Benno Schulenberg 6bead051d2 justify: move the check for a bad quoting regex to a better place
So that the cursor will not move when a justification is attempted.
2018-11-26 10:56:20 +01:00
Benno Schulenberg ac8bd2a227 tweaks: elide a parameter -- do the NULL checks in the caller
Determine more directly: the length of the last paragraph line,
and the exit condition for a full justify.
2018-11-26 10:38:04 +01:00
Benno Schulenberg 0d96df7a91 tweaks: condense and improve a couple of comments 2018-11-26 09:38:02 +01:00
Benno Schulenberg e2c61d83ef tweaks: change do_para_end() to not step beyond end of paragraph
Not stepping beyond the last line of the paragraph means that the
length of the paragraph is always the difference in line numbers
(between first and last line of the paragraph) plus one.
2018-11-26 09:16:09 +01:00
Benno Schulenberg 9a77c997e2 tweaks: remove two tag definitions that are no longer needed 2018-11-26 09:13:22 +01:00
Benno Schulenberg 2cee79fbbf tweaks: remove a variable that is no longer used
It was made superfluous by David's overhaul of the justify mechanism.
2018-11-26 09:07:22 +01:00
Benno Schulenberg 2c126b201f text: turn the mark off when justifying, to not confuse an undo
When leaving the mark on while justifying and then undoing the
justification, things are likely to get messed up.  My applying
David's patches only partially caused this breakage.

This fixes https://savannah.gnu.org/bugs/?55074.
2018-11-25 20:10:30 +01:00
Benno Schulenberg 2500debbd2 tweaks: don't bother zeroing the x position when doing a full justify
The x position of the cursor is irrelevant when doing justifications.
2018-11-25 15:23:24 +01:00
Benno Schulenberg 500c41b83b tweaks: move the check for beginning-of-paragraph to a better place
Only the first search for a paragraph needs to check whether we're
currently in the middle of a paragraph.  When the 'while' loop for
a full justify is executed, all calls of find_paragraph() start
either on the first line of a paragraph or between two paragraphs.
2018-11-25 15:20:48 +01:00
Benno Schulenberg 2c83047842 tweaks: condense the logic of find_paragraph()
To find a paragraph, what needs to be done is:

  a) When not in a paragraph, move forward until we find one, if any.
  b) When in a paragraph but not at its start, move back to its start.
  c) Move forward to the end of the paragraph, if any.
2018-11-25 13:22:45 +01:00
Benno Schulenberg 5f5682240a tweaks: remove a superfluous check for a special case
The case is handled fine by the rest of the code.  The unnecessary
check wastes some cycles for every call of find_paragraph().
2018-11-25 12:43:29 +01:00
Benno Schulenberg 4a70c1393f tweaks: improve a comment, to better match the changed code 2018-11-25 12:24:57 +01:00
Benno Schulenberg 66cd897dc4 justify: correctly detect when we've reached end of buffer
When, in the 'while' loop for a full justify, 'filebot_inpar' becomes
TRUE, it means that EOF has been reached and find_paragraph() should
not be called again.  To allow 'filebot_inpar' to convey this meaning,
it should not be set to TRUE elsewhere, so another boolean is needed
for setting the correct length of the final line of the cutbuffer.

This fixes https://savannah.gnu.org/bugs/?55086.
2018-11-25 11:57:10 +01:00
Benno Schulenberg 67e6eee26e tweaks: rename two parameters to be more descriptive
Also rename one variable, to be more general, as it does not always
point to a line in a paragraph.
2018-11-22 20:54:22 +01:00
Benno Schulenberg 7ccdb1970a tweaks: elide two unneeded intermediate variables 2018-11-22 20:43:40 +01:00
Benno Schulenberg 539a18e4c7 tweaks: condense and improve a handful of comments, and rewrap two lines 2018-11-22 20:02:29 +01:00
Benno Schulenberg a7083d632b tweaks: improve a comment, and add an intermediate variable for clarity 2018-11-21 19:49:09 +01:00
David Lawrence Ramsey 44ea37573a docs: remove references to not being able to undo justifications
Any series of justifications (and other edits) is now undoable.
2018-11-20 19:21:35 +01:00
David Lawrence Ramsey d54840c152 text: hook the new justify mechanism up to the undo system
This fixes https://savannah.gnu.org/bugs/?46900.
2018-11-20 19:21:35 +01:00
David Lawrence Ramsey 14c085898b text: make do_justify() use the cutbuffer
This is the last preparation for making justifications undoable in
the regular way.
2018-11-20 19:21:35 +01:00
David Lawrence Ramsey fb38995d36 tweaks: adjust some indentation after the previous change 2018-11-20 19:21:35 +01:00
David Lawrence Ramsey 2cdb87ee62 text: remove the old unjustify mechanism, to prepare for the new justify
This leaves two variables unused, but they will be used again two commits
from now, when do_justify() is converted to use the cutbuffer.
2018-11-20 19:21:35 +01:00