Commit Graph

6183 Commits (de3260cdb1d9dfe6b9da665e294a44df84388163)

Author SHA1 Message Date
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
Benno Schulenberg f8841f0927 docs: standardize the dates in the old Changelog
(Hooray for nano's regex replacements.)
2017-01-04 12:52:37 +01:00
Benno Schulenberg 8d692a87dc softwrap: don't scroll half a page when just a few lines will do
This fixes https://savannah.gnu.org/bugs/?49824.
2017-01-03 15:26:05 +01:00
Benno Schulenberg 13176792f0 tweaks: frob some comments, elide a variable, and use 'while' loops 2017-01-03 15:05:42 +01:00
David Lawrence Ramsey d7fbc70a72 tweaks: avoid an unnecessary fiddling with current_y in do_mouse()
Since do_mouse() uses edit_redraw(), openfile->current_y will be
immediately recalculated, so there's no point in changing it now.
Use a temporary variable instead.
2017-01-03 14:44:53 +01:00
David Lawrence Ramsey 1dd01eb4e1 tweaks: move a setting, fix a type, and rearrange a line in do_mouse()
The value of sameline doesn't change, so it can be initialized to that.

Since i holds openfile->current_y, it should be ssize_t, not size_t.

And it's better to do the most significant part of a calculation first.
2017-01-03 14:23:40 +01:00
Benno Schulenberg fd0589d8bc tweaks: remove the cluttering conditional compilation of a parameter
The conditionalizing saved negligible amounts of space, of memory, and
of speed.
2017-01-03 14:11:45 +01:00
Benno Schulenberg a381021ffc tweaks: when allow_tabs is FALSE, allow_files is irrelevant
In that case setting the latter to TRUE is misleading.  So don't do that.
2017-01-03 14:02:52 +01:00
Benno Schulenberg 0b0ddb1e5f tweaks: rename a variable, chuck an assert, and frob a comment 2017-01-03 14:01:35 +01:00
Benno Schulenberg 991e49a36a docs: bring some air into the FAQ, so that <Ctrl+Up/Down> become useful 2017-01-03 14:00:21 +01:00
David Lawrence Ramsey b1c20629f5 weeding: remove unnecessary settings of openfile->current_y
Many of the adjustments of the value of openfile->current_y appear to be
a holdover from the days when certain functions had to account for what
is now called STATIONARY scrolling mode, which depends on the value of
current_y.  Remove these adjustement where they are superfluous.

do_para_begin(), do_para_end(), and do_bracket_match() update the screen
through edit_redraw(), which uses either CENTERING or FLOWING scrolling
mode, so their setting of current_y is redundant and useless, as it will
be ignored and then overridden by the next call to reset_cursor().

findnextstr() is called by go_looking() [which calls edit_redraw(), see
above], and by do_replace_loop() and do_int_spell_fix(), which both call
edit_refresh(), which in this case only uses CENTERING scrolling mode
since focusing is TRUE.

(Additionally, the adjustments of current_y in findnextstr() and
do_bracket_match() use incorrect values when in softwrap mode.)

find_paragraph() doesn't need to save or restore current_y, because it
doesn't do any screen updates.  do_justify() calls edit_refresh() with
focusing set to TRUE, so it uses the CENTERING scrolling mode.

do_alt_speller() and do_formatter() do not need to save and restore
current_y, because they don't modify it in any way.

This addresses https://savannah.gnu.org/patch/?9197.
2017-01-02 12:40:21 +01:00
Benno Schulenberg 7373e4cd46 tweaks: fix compilation when configured with --disable-wrapping 2017-01-01 16:33:40 +01:00
Benno Schulenberg 5f30775d62 inserting: adjust the desired x position (don't restore the old one)
This makes nano's cursor behavior consistent across 1) typing text by
hand; 2) pasting in text with ^U; 3) inserting text from a file; and
4) redoing with M-E that same typing or pasting or inserting.

This fixes https://savannah.gnu.org/bugs/?49968.
2017-01-01 15:32:25 +01:00
Benno Schulenberg 69bd4d1f06 tweaks: slightly condense a function and its comment 2017-01-01 15:06:39 +01:00
Benno Schulenberg d3429a7a57 copy: properly set preferred x position when region was marked backwards
This fixes https://savannah.gnu.org/bugs/?49964.
2016-12-31 16:36:14 +01:00
Benno Schulenberg e1538e6dc3 tweaks: reshuffle a statement to a better place and condense some comments 2016-12-31 13:55:52 +01:00
Benno Schulenberg 1c46551ce8 cut: indicate a buffer as modified only if actually something was deleted
This fixes https://savannah.gnu.org/bugs/?49962.
2016-12-31 13:10:06 +01:00
Benno Schulenberg f1b87f960c build: rename the sample config file, so it will be colored like a nanorc 2016-12-30 22:05:01 +01:00
Benno Schulenberg b0ef2e2803 build: move the syntax files out of the doc/ directory
They are not documentation, they are functional elements of nano.
2016-12-30 22:05:01 +01:00
Benno Schulenberg 6981294c9d build: move all documentation into a single directory
There are just a handful of source files for the documentation --
it is wasteful and cumbersome to have these in separate directories.

Also: remove the French man pages -- they are too far out of date.
(And anyway, we should acquire a general framework for translating
the documentation.)
2016-12-30 22:05:00 +01:00
Felix Janda fc89ac11d2 speller: fix build when tiny build is enabled
URL: https://bugs.gentoo.org/604000
2016-12-29 13:43:06 -05:00
Benno Schulenberg 9f92fb3ec4 po: update translations and regenerate POT file and PO files 2016-12-28 12:58:50 +01:00
Benno Schulenberg 293423bdda bump version numbers and add a news item for the 2.7.3 release 2016-12-28 12:24:05 +01:00
Benno Schulenberg 32719d64a1 locking: disable an annoying warning
The warning is wrong when the user has just saved a buffer under a
new name.  And when --quickblank is used, the warning most likely
gets cleared off before it is seen, and the user would just hear
the beep and be left wondering what happened.

This avoids https://savannah.gnu.org/bugs/?49875.
2016-12-28 12:04:55 +01:00
Benno Schulenberg f4321250ef docs: clarify the difference between "Esc Esc ddd" and "M-V xxxxxx" 2016-12-28 11:54:49 +01:00
Benno Schulenberg 908663e8fc input: discard a verbatim 0x0A or 0x00 byte, depending on the mode
This disallows entering a verbatim ^J (0x0A) when typing text or
search terms, and disallows a verbatim ^@ (0x00) when typing a
filename.  Nano beeps when the disallowed code is attempted.

This addresses https://savannah.gnu.org/bugs/?49897.
2016-12-27 16:46:09 +01:00
Benno Schulenberg 1fb820386b tweaks: chuck a special case, and reduce the scope of two variables
A KEY_WINCH does not need to be separately treated since the basic
action for anything that is not recognized at the yes-no prompt is:
to continue.
2016-12-26 20:25:06 +01:00
Benno Schulenberg 9973366685 prompt: represent newlines as ^J instead of breaking the bar
Also at the yes-no prompt, a 0x0A byte should be displayed as a ^J
instead of splitting the prompt bar in two and spreading it over
two lines.

This fixes https://savannah.gnu.org/bugs/?49934.
2016-12-26 19:59:51 +01:00
Benno Schulenberg e72db0e350 files: show newlines in filenames as ^J also in error messages
When a given file is, for example, unreadable or unwritable, the
error message should use ^J instead of ^@ in its name.
2016-12-26 12:35:50 +01:00
Benno Schulenberg 87b2df6dea utils: go on to parse the line number even if the column number is bad
This fixes https://savannah.gnu.org/bugs/?49933.
2016-12-26 11:45:38 +01:00
Benno Schulenberg c24caf5fb8 tweaks: rename four variables, for density and aptness 2016-12-26 11:01:40 +01:00
Benno Schulenberg 8db21b68d5 tweaks: use memory on the stack instead of calling malloc() and free() 2016-12-26 10:39:48 +01:00