Commit Graph

9969 Commits

Author SHA1 Message Date
Benno Schulenberg
a1ba7ee786 bump version numbers and add a news item for the 6.2 release 2022-02-18 10:44:22 +01:00
Benno Schulenberg
756cd4a4b8 tweaks: store a result, to avoid calling a function twice 2022-02-18 10:27:47 +01:00
Benno Schulenberg
1b186fcff3 tweaks: rename two more variables, and drop unneeded initializations
Also, make sure that there is a space in the complaint so that the
later strstr() call cannot fail.  And reshuffle a line.
2022-02-17 14:20:45 +01:00
Benno Schulenberg
165da9b447 tweaks: rename a variable, reshuffle five lines, and snip two comments 2022-02-17 14:00:55 +01:00
Benno Schulenberg
aea10ed383 tweaks: rename two variables (to get rid of a prefix), and elide a third 2022-02-17 13:57:22 +01:00
Benno Schulenberg
8fccb31436 linter: adjust the parsing to accommodate for a modern 'pyflakes'
In version 2.2.0, pyflakes changed its output format,
from 'filename:line: text' to 'filename:line:column text'.

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

Problem existed since version 2.9.0, commit 5dcf375f.

(That commit tried to compensate for an introductory message from gcc
that no longer seems to exist.)
2022-02-16 15:39:01 +01:00
Benno Schulenberg
89bb88e4f5 syntaxes: fold a couple of regexes together, and improve a few comments 2022-02-16 13:07:11 +01:00
Benno Schulenberg
a58efa70bc tweaks: consistently backslash-escape the dash in M-letter keystrokes 2022-02-16 12:19:31 +01:00
Benno Schulenberg
fe1fecc5da tweaks: rename a variable, to be more correct, and adjust two comments
The new name 'gauge' more clearly indicates that it is a distance
between two "columns", two "pillars", two "piles".  Using 'longest'
was poor, because in fact it was set to 'widest + 10'.

(Also, change the type of 'piles' to an integer -- it will always
be smaller than COLS, and COLS is an integer.)
2022-02-13 13:07:52 +01:00
Benno Schulenberg
87612582ff tweaks: use an intermediate variable, to avoid using one for two purposes 2022-02-13 12:43:55 +01:00
Benno Schulenberg
c3a53cffbc tweaks: rename a variable, to be more fitting
It is about width (cells/columns), not about length (bytes).
2022-02-13 12:19:16 +01:00
Benno Schulenberg
aeea83703b tweaks: rename a misnamed variable 2022-02-13 12:04:57 +01:00
Benno Schulenberg
27c8f13fc9 tweaks: change the type of a variable, to avoid a compiler warning
A newer compiler (gcc-10.3) said: browser.c:174:34: warning:
  field width specifier '*' expects argument of type 'int'

It's fine for 'longest' to be an integer, as a filename in Unix is
at most 255 bytes long, which can occupy at most 510 columns (when
the name consists entirely of control codes), and that fits easily
within an 'int', which has at least fifteen bits, unsigned.

Well... in theory 'tabsize' could be set to an insanely high number,
and if a filename contains several tabs, this could cause 'longest'
to overflow.  (Why doesn't the compiler warn about that?)  If that
were to occur, and the filename with the tabs were the last in the
list, then 'longest' would get set to the minimum width: 15.  That
would not be correct, but... nothing bad would happen.

This addresses https://savannah.gnu.org/bugs/?62014.
Reported-by: Mike Frysinger <vapier@gentoo.org>
2022-02-13 11:54:14 +01:00
Benno Schulenberg
c6ddae70f7 display: suppress the bottom-bar wiping only when the user is editing
This wipe suppression is meant to prevent the last row of the edit window
getting cleared when edit window and bottom window overlap, and this is
relevant only when the user is actually editing -- the file browser and
help viewer take care not to use this bottom row for content.

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

Bug existed since version 6.0, commit be61aad9.
2022-02-11 16:46:05 +01:00
Benno Schulenberg
e4ecd03e3f po: update translations and regenerate POT file and PO files 2022-02-09 11:53:47 +01:00
Benno Schulenberg
a6dc5c963c bump version numbers and add a news item for the 6.1 release 2022-02-09 11:31:03 +01:00
Benno Schulenberg
989e6a9a7e tweaks: rename two variables, and elide a near-enough duplicate
(The 'in_edit' variable was a duplicate because also when the pointer is
on the line numbers, we want to scroll when the mouse wheel is rolled.)
2022-02-04 15:51:40 +01:00
Benno Schulenberg
c28048d20f tweaks: rename another variable, to better fit in with its sisters 2022-02-04 12:17:37 +01:00
Benno Schulenberg
a24e72f972 tweaks: rename a variable, to make it clearer it refers to a window 2022-02-04 12:11:05 +01:00
Benno Schulenberg
a29aa31e93 tweaks: when discarding keycodes, don't bother parsing them 2022-02-04 11:18:52 +01:00
Benno Schulenberg
8546139997 build: fix compilation when configured with --enable-tiny
Problem existed since commit 3b657a26 from five days ago.

In addition, exclude pasting-at-the-prompt from the tiny version, as
it's hardly useful when one cannot copy a selected piece of text.
2022-02-03 13:06:21 +01:00
Benno Schulenberg
a61586947e gnulib: update to its current upstream state 2022-02-03 11:20:08 +01:00
Benno Schulenberg
5e4645b082 copyright: update the last year for significantly changed files 2022-02-02 17:40:25 +01:00
Benno Schulenberg
f9f0a8fd67 copyright: update the years for the FSF 2022-02-02 17:10:09 +01:00
Benno Schulenberg
637a2eeb66 tweaks: rename a variable and a parameter, to be more descriptive
Also, improve two comments, to describe what the functions actually do.
2022-02-01 12:22:29 +01:00
Benno Schulenberg
13caef2de0 tweaks: remove two redundant checks
The checks have been there for fifteen months, and no one ever reported
seeing those messages.
2022-02-01 12:21:31 +01:00
Benno Schulenberg
61c6d43231 tweaks: adjust a translator hint, to fit the order in the POT file
Also, reword another hint.
2022-02-01 11:38:55 +01:00
Benno Schulenberg
a04f6e0165 help: update the description of M-D, to match the actual order of counts 2022-02-01 11:16:07 +01:00
Benno Schulenberg
3f494e359d tweaks: stop asking the terminal for its new size -- let ncurses do it
When re-entering curses mode, ncurses will pick up the new size of
the terminal and set the LINES and COLS variables appropriately.

(We don't ask the terminal for its size when nano starts up, so why
would we need to do it when the terminal is resized?)
2022-01-31 16:53:35 +01:00
Benno Schulenberg
8a06f70379 tweaks: rename a function and reshuffle its call 2022-01-31 12:31:03 +01:00
Benno Schulenberg
2290152743 menus: don't show M-6 in the help lines of any prompt
None of the editing keystrokes are shown in the menus -- they are
all "blind" keys.  This corrects a mistake in the previous commit.
2022-01-31 10:48:14 +01:00
Benno Schulenberg
3b657a26a6 prompt: allow the user to copy the answer to the cutbuffer (with M-6)
Since version 2.8.7 the user can paste text at the prompt (with ^U),
but the ability to copy what is present at the prompt was overlooked.

For feedback, the cursor is moved to the start of the answer -- like
it moves to the start of the next line when in the edit buffer.

This addresses https://savannah.gnu.org/bugs/?61702.
Reported-by: Tasos Papastylianou <tpapastylianou@hotmail.com>
2022-01-30 17:39:55 +01:00
Benno Schulenberg
ff5084479b prompt: let ^K erase text after cursor (if any), otherwise whole answer
In most cases, the cursor will be at the end of what the user typed
at the prompt (or retrieved from history), and ^K will work as it
always did, erasing the whole answer.  But if the user has moved the
cursor to somewhere in the middle of the answer, a ^K will now erase
just the part after the cursor.  A second ^K will erase the rest.

Inspired-by: Tasos Papastylianou <tpapastylianou@hotmail.com>
2022-01-29 17:23:42 +01:00
Benno Schulenberg
97f4a3f4eb tweaks: rename a variable, away from an abbreviation 2022-01-29 17:14:22 +01:00
Benno Schulenberg
1ca1732d32 tweaks: remove a redundant check -- add a different one for symmetry
Function get_input() with a non-null parameter will never return ERR.
2022-01-29 16:32:04 +01:00
Benno Schulenberg
accd2308f1 tweaks: reword two comments, and rename a variable (away from an abbrev) 2022-01-29 16:01:35 +01:00
Benno Schulenberg
10eec2fe17 input: suppress any spotlighting when there are more keycodes waiting
Because doing the spotlighting after those extra keycodes have been
handled will most likely spotlight the wrong piece of text.  Also,
if those keycodes hadn't arrived early, the first of them would have
cancelled the spotlighting.

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

Bug existed since version 5.8, commit 3f340836.
2022-01-29 11:16:41 +01:00
Benno Schulenberg
d69cd759cb input: instead of moving waiting keycodes, just increment a pointer
When a large piece of text was pasted into nano, then the old way of
repeatedly moving the buffered text one more position toward the head
of the keystroke buffer would waste a lot of time.  With this change,
pasting the current NEWS file into a buffer goes down (on my machine)
from around 30 seconds to just 2.

This addresses https://savannah.gnu.org/bugs/?61822.
Reported-by: Radu Caragea <rcaragea@protonmail.com>

Problem existed in this form since version 1.3.6, commit 7483571f.
2022-01-27 10:41:24 +01:00
Benno Schulenberg
f261a8aca5 tweaks: rename a function, to not contain the name of a variable 2022-01-27 09:21:21 +01:00
Benno Schulenberg
bdf64d660b tweaks: rename a variable, for clarity and contrast 2022-01-27 09:21:21 +01:00
Benno Schulenberg
2fd30ee095 tweaks: rename a function and its two parameters, for clarity 2022-01-25 12:23:14 +01:00
Benno Schulenberg
9bc6f1797e tweaks: use some symbolic names instead of unclear numeric values 2022-01-25 11:57:34 +01:00
Benno Schulenberg
32e63fe1b8 tweaks: add some small, clarifying comments
Suggested-by: Tasos Papastylianou <tpapastylianou@hotmail.com>
2022-01-22 13:12:55 +01:00
Benno Schulenberg
1c074cc8cc files: let ^C cancel the exiting when the file on disk was changed
When the user exits with ^X and gets warned that the file on disk
has changed, then typing ^C at the question whether to continue
saving should not discard the buffer and exit, but should return
the user to the filename prompt.

This fixes https://savannah.gnu.org/bugs/?61883.
Reported-by: Tasos Papastylianou <tpapastylianou@hotmail.com>

Bug existed since version 2.9.0, commit 217cfbf3.
2022-01-22 12:30:15 +01:00
Benno Schulenberg
ebf6228f21 tweaks: add some feedback to the autogen.sh script, to ease the wait 2021-12-28 15:31:23 +01:00
Benno Schulenberg
4a1db96db8 build: prevent autopoint from overwriting a newer M4 file from gnulib
For some reason, 'autopoint' (invoked by 'autoreconf') insists on
overwriting 'extern-inline.m4', even though the version from gnulib
is newer and contains a fix for a build issue on macOS with GCC 11.

So, do as the documentation says, and invoke 'autopoint' before
'gnulib-tool' (and call 'aclocal' to 'automake' afterwards).

  https://www.gnu.org/software/gnulib/manual/html_node/gettextize-and-autopoint.html

This fixes https://savannah.gnu.org/bugs/?61719.
Reported-by: Sam James <sam@cmpct.info>
2021-12-28 15:08:45 +01:00
Benno Schulenberg
16ee4636bc tweaks: reshuffle some sample bindings, to group them differently 2021-12-26 17:44:42 +01:00
Benno Schulenberg
6831b37b43 tweaks: drop foreign M-U and M-R from among the sample CUA bindings
M-U and M-R are not usual bindings for Undo and Redo.
2021-12-26 17:35:30 +01:00
Benno Schulenberg
4d16f26ba4 help: make the description of <Tab> more accurate
And don't mention <Tab> for the 'indent' function, as the keystroke
is equivalent to M-} only when lines are marked.

Reported-by: Tasos Papastylianou <tpapastylianou@hotmail.com>
2021-12-26 11:57:57 +01:00
Benno Schulenberg
4a7bc73e03 docs: mention 'set guidestripe' and 'set unix' in the sample nanorc
Somehow these entries were missed when those options were added.

Reported-by: Tasos Papastylianou <tpapastylianou@hotmail.com>
2021-12-24 17:38:10 +01:00