Commit Graph

6114 Commits

Author SHA1 Message Date
Benno Schulenberg
980e334e37 tweaks: rearrange some code to separate softwrap and normal mode more
(Ignore the indentation for the moment.)
2017-01-13 19:17:59 +01:00
Benno Schulenberg
9bb64fccef tweaks: chuck some obscuring debugging stuff 2017-01-13 17:47:55 +01:00
David Lawrence Ramsey
6e3adf31b8 tweaks: let update_line() return the correct value on error
If the given line is out of range of editwinrows, we don't display it
at all, so we obviously don't display more than one line of it.  Thus,
the return value in this case should be zero, not one.
2017-01-13 17:41:26 +01:00
David Lawrence Ramsey
c67c431239 tweaks: improve comments and formatting in update_line() 2017-01-13 17:36:02 +01:00
Benno Schulenberg
bf0268d41d tweaks: condense a comment, rename a variable, and use a while loop 2017-01-12 21:31:08 +01:00
Benno Schulenberg
b7c2513f7d tweaks: rename some variables, to better distinguish rows from lines
And columns from indexes -- columns are places on the screen, while
indexes point to characters in a line in the current buffer.
2017-01-12 19:32:21 +01:00
Benno Schulenberg
892762d99c tweaks: rename some variables, to show they refer to screen rows 2017-01-12 18:03:36 +01:00
Benno Schulenberg
f7d320d932 tweaks: rename a function, to show it refers to screen rows 2017-01-12 17:48:33 +01:00
Benno Schulenberg
0208ae7149 tweaks: rename a variable -- lines refers to buffer, rows to screen 2017-01-12 17:33:46 +01:00
Benno Schulenberg
26fb907aa6 screen: ehm... no, that was wrong: page_start /is/ a column position
(The mistake becomes visible when you go to the end of a very long line
of double-width characters: the $ will be shown on the right edge, even
though you're already at line's end.)

This reverts commit 16a7fd4b from yesterday.
2017-01-12 10:29:20 +01:00
Benno Schulenberg
ea40765904 tweaks: rename two variables, and always pass a valid result back
What is the point of parsing a number when you're not interested in
the result?  All callers of parse_num() pass a container for it.
2017-01-11 19:24:35 +01:00
Benno Schulenberg
16a7fd4bfc screen: don't compare a character index with a column position
This addresses part of https://savannah.gnu.org/patch/?9216.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>
2017-01-11 17:22:46 +01:00
Benno Schulenberg
eca6faee5b tweaks: free an option string also when it was invalid 2017-01-11 09:49:24 +01:00
Benno Schulenberg
59edef55dc po: update translations and regenerate POT file and PO files 2017-01-10 11:35:00 +01:00
Benno Schulenberg
f119a90fe5 bump version numbers and add a news item for the 2.7.4 release 2017-01-10 11:29:34 +01:00
Benno Schulenberg
4920030384 docs: snip some obsolete items from the FAQ, and normalize its dates 2017-01-09 21:43:59 +01:00
Benno Schulenberg
a898fa5dcc tweaks: if there is no end match, there is nothing to paint
When there is no end match after a start, it is pointless to look
for any more starts because also they will not have any end match,
so nothing will get painted -- just cut the loop short.
2017-01-09 19:14:51 +01:00
Benno Schulenberg
c0aa5ad258 tweaks: miscellaneous frobbings 2017-01-09 18:25:25 +01:00
Benno Schulenberg
58c3dd6cd0 softwrap: when typing M-/, ensure the last line is fully visible 2017-01-09 15:21:15 +01:00
Benno Schulenberg
5ca765f107 tweaks: discard some conditional compilation 2017-01-09 15:09:06 +01:00
Benno Schulenberg
cf75da9888 softwrap: when pasting an overlong line, ensure it is fully visible
This fixes https://savannah.gnu.org/bugs/?50009.
2017-01-09 15:00:29 +01:00
Benno Schulenberg
14c62dbf11 build: check for GNU-style word-boundary support also in the tiny version
The tiny version can do regex searches nowadays, so the user might use
the \< and \> anchors in their regexes.

This fixes https://savannah.gnu.org/bugs/?50008.
2017-01-09 14:32:01 +01:00
Benno Schulenberg
f6fbc1572d tweaks: adjust whitespace after the previous change 2017-01-09 12:01:27 +01:00
Benno Schulenberg
38d7362f20 tweaks: rename two variables to be just one as they play the same role
The renamed variable 'index' is not the start of a match (as some comment
mistakenly said), but from where in the line we start looking for a next
match.

Also, use one more goto to allow unindenting a big piece of code, and
shortcircuit two while loops for two more small unindents.
2017-01-09 11:39:37 +01:00
Benno Schulenberg
26683a9e5f tweaks: frob some comments, and transform one variable 2017-01-08 21:31:49 +01:00
David Lawrence Ramsey
d35ecd02b8 weeding: remove another unnecessary setting of openfile->current_y
The setting of current_y in copy_from_filestruct() also appears to be
a holdover from the days of a more-common STATIONARY scrolling mode.

do_cut_text() uses the above function when copying text (uncutting
text again right after cutting it).  Since the text is effectively
the same afterward, current_y doesn't need to change.

do_uncut_text(), however, does need current_y up to date in one case:
when uncutting a full screen or less' worth of lines, focusing will be
FALSE, and it uses edit_refresh(), so it will use STATIONARY scrolling
mode then.  Take a cue from do_insertfile() and call reset_cursor() to
get an updated current_y.

(Note that the check for a full screen or less' worth of lines uses
incorrect values when in softwrap mode, but that's a separate problem.)

undo_cut(), do_redo(), and backup_lines() do not need set current_y
because they all result in edit_refresh() with focusing = TRUE, so
they do a CENTERING scroll which does not need current_y.
2017-01-08 17:18:28 +01:00
Benno Schulenberg
61bc248555 tweaks: chuck a couple of useless asserts 2017-01-08 15:27:48 +01:00
David Lawrence Ramsey
c38f571d4b tweaks: line numbers are ssize_t, not int 2017-01-08 15:13:11 +01:00
Benno Schulenberg
a89437219d tweaks: don't use a variable for two different purposes
At first paintlen was computed as a column span, and then converted
to a character count...  Confusing.
2017-01-08 13:34:10 +01:00
Benno Schulenberg
aa28441071 tweaks: the starting point for painting /cannot/ be offscreen
The top_x variable has already been forced to become equal to from_x
if it was before it.  So start_col will be at least zero.
2017-01-08 13:34:04 +01:00
Benno Schulenberg
5dbd288254 tweaks: rename another variable, to show it refers to columns not chars 2017-01-08 13:12:40 +01:00
Benno Schulenberg
8f21d256fb tweaks: rename two variables, for distinguishing characters from columns 2017-01-08 13:12:36 +01:00
Benno Schulenberg
08cfdbcbdb tweaks: don't compare a character offset with a column position
It is the misuse of "x_" to mean a column position on screen, and the
misuse of "_col" to mean a character position in a string that causes
this confusion.
2017-01-08 13:12:11 +01:00
Benno Schulenberg
6103c47f1c tweaks: rename three painting variables, to be more distinct
All these different "start"s and "end"s are confusing.  Use instead
'from_x and 'till_x' to remember which part of the current line is
visible now on screen and is thus represented in 'converted'.
2017-01-08 11:35:07 +01:00
Benno Schulenberg
88cf22f804 tweaks: rearrange and reindent some lines in the painting routines
Also adjust a few comments.
2017-01-08 11:33:57 +01:00
Benno Schulenberg
8177e62c18 screen: examine the whole line when painting, to set the correct info
In order to determine the correct multidata for a line that doesn't
have such data yet, the whole line must be examined, not just the
part that fits within the screen width.

This fixes https://savannah.gnu.org/bugs/?49978.
2017-01-08 11:33:57 +01:00
Benno Schulenberg
124a859516 syntax: html: be more precise with tags, and paint attribute names
A tag begins not merely with a "<" but it must be followed by an
ASCII alphabetic character or one of "/", "!" and "?".

Further, color all the valid attribute names in red.
2017-01-08 11:32:30 +01:00
Benno Schulenberg
322120c980 undo: properly create separate items for deletes at different positions
That is: only extend the current Del or Backspace undo item when the
cursor is still (or again) at the same spot.

This fixes https://savannah.gnu.org/bugs/?50006.
2017-01-08 11:05:52 +01:00
Benno Schulenberg
54e6fe2b4a build: install the Info and Html manuals even when 'makeinfo' is missing
If the system on which nano is configured does not have the 'makeinfo'
program installed, the prebuilt and packaged nano.info and nano.html
should nevertheless be installed.

Also, the TEXINFOS primary has built-in rules for generating HTML files
from the texinfo sources, so an explicit rule is not needed.

This indirectly addresses https://savannah.gnu.org/bugs/?49969.
2017-01-06 20:01:41 +01:00
Benno Schulenberg
fa56310454 build: include the old Changelogs in the tarball
(This should have been updated when the Changelogs were renamed.)
2017-01-06 19:31:48 +01:00
David Lawrence Ramsey
f35c3dbd57 softwrap: ensure the current line is fully visible after inserting a file
This fixes https://savannah.gnu.org/bugs/?49994.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>
2017-01-06 14:01:47 +01:00
David Lawrence Ramsey
acb394aec0 screen: properly place the cursor after inserting a file
Instead of setting openfile->current_y (and wrongly so), just call
reset_cursor() to recompute current_y and place the cursor on that
line (if it is not offscreen).
2017-01-06 14:00:37 +01:00
Benno Schulenberg
4223b83f75 tweaks: condense two ifs to a single one 2017-01-06 10:57:53 +01:00
Benno Schulenberg
4a1302ef55 tweaks: rename two variables, to be more telling 2017-01-05 22:47:01 +01:00
Benno Schulenberg
cbf7e57ed0 search: make a regex with a beginning-of-word anchor work correctly
The search routine begins searching right after the cursor and behaves
as if the line starts there, which means that a beginning-of-word anchor
(\< or \b) will match there also when in fact the cursor is sitting in
the middle of a word.  To prevent finding a false match, verify that
for a regex that starts with a BOW anchor the found match is actually
the start of a word.

This fixes https://savannah.gnu.org/bugs/?45630.
2017-01-05 22:38:10 +01:00
Benno Schulenberg
e36e829ad0 tweaks: set the length of a search match in a clearer manner 2017-01-05 21:25:30 +01:00
Benno Schulenberg
121c53f3b8 docs: add a new Changelog -- a list of the short commit messages 2017-01-04 16:19:39 +01:00
Benno Schulenberg
5b9683cd64 docs: rename the Changelogs to indicate which periods they cover 2017-01-04 16:01:50 +01:00
Benno Schulenberg
7c1dfea59e tweaks: terminate lots of sentences with a period in the old Changelog 2017-01-04 15:52:20 +01:00
Benno Schulenberg
4a073a0f3e docs: fix some spellos and trim some trailing tabs in the old Changelog 2017-01-04 13:48:25 +01:00