10570 Commits

Author SHA1 Message Date
Benno Schulenberg
2e2a40ea09 docs: document the new --solosidescroll and 'set solosidescroll' options
These re-enable the historical jerky single-line sideways scrolling.
2026-01-23 17:37:03 +01:00
Benno Schulenberg
38f87fb5c3 display: add extra variable, to avoid one-way toggling of SOLO_SIDESCROLL
Panning should not be switched off for the whole session
when the window became too narrow at some point.
2026-01-23 17:37:03 +01:00
Benno Schulenberg
f6297f0933 display: for narrow windows, fall back to single-line sidescrolling
Otherwise the cursor can get misplaced sometimes.
2026-01-23 17:37:03 +01:00
Benno Schulenberg
a7e8dd7d6b options: accept --solosidescroll and 'set solosidescroll'
These options activate the old, jerky, single-line sideways scrolling
instead of the new default smooth whole-window sideways scrolling.
2026-01-23 17:37:03 +01:00
Benno Schulenberg
7779a19903 new default feature: smooth whole-window sideways scrolling
Instead of horizontally scrolling just the current line by nearly
a screen width when the cursor is about to go offscreen, now all
screen lines are scrolled horizontally together by just the amount
needed to keep the cursor comfortably in view.

References:
  https://lists.gnu.org/archive/html/nano-devel/2026-01/msg00000.html
  https://lists.gnu.org/archive/html/nano-devel/2026-01/msg00003.html
  https://lists.gnu.org/archive/html/nano-devel/2014-05/msg00025.html
  https://lists.gnu.org/archive/html/nano-devel/2014-06/msg00152.html

Nano could have acquired this feature nearly twelve years ago, but...
somehow that old patch fell through the cracks and was forgotten.  :|

Motivated-by: Xylia Allegretta <xylia.allegretta@gmail.com>
Original-patch-by: Mark Majeres <mark@engine12.com>
2026-01-23 17:37:03 +01:00
Benno Schulenberg
255845cc13 tweaks: correct a comment 2026-01-23 16:27:10 +01:00
Benno Schulenberg
f7c96dba4a copyright: update the years for the FSF 2026-01-17 12:12:55 +01:00
Benno Schulenberg
299aab6acf tweaks: refer to two renamed gnulib modules with their adjusted names 2025-12-06 12:11:05 +01:00
Benno Schulenberg
3295ca6bd8 copyright: update the years for significantly changed files 2025-11-27 11:27:31 +01:00
Benno Schulenberg
632542462a tweaks: rename two functions, reword some comments, rewrap a line 2025-11-24 15:23:02 +01:00
Benno Schulenberg
bd72b21c18 mouse: allow clicking before the answer to place cursor at its beginning
In the prompt bar, clicking beyond the end of the answer places the
cursor at the end of the answer.  Then it makes sense that clicking
before the beginning of the answer places the cursor at its beginning.
2025-11-24 13:07:30 +01:00
Benno Schulenberg
31fc5194b2 new feature: clicking in the scrollbar jumps to the corresponding line
With --mouse and --indicator, clicking in the rightmost column of
the edit window (the "scrollbar" area) now makes the cursor jump
to the line that places the indicator at the clicked position.

Inspired-by: Firefox, and originally by tilde and fte.
2025-11-24 11:21:08 +01:00
Benno Schulenberg
fc1d88a00f tweaks: avoid having to restore the original click coordinates
When going to handle clicks on shortcuts, the help lines are present,
so we know exactly where the prompt is (third line from the bottom),
so there is no need to first convert the coordinates to be relative
to the bottom window and then restore them when `mouse_y` is zero.
2025-11-24 11:05:23 +01:00
Benno Schulenberg
54e1619d6e tweaks: condense two oververbose comments 2025-11-24 11:05:23 +01:00
Benno Schulenberg
b4246d2cac tweaks: remove an unneeded parameter from get_mouseinput()
Only the Yes-No routine handles clicks on shortcuts itself, so just
exclude that menu from the shortcut handling by mouse, instead of
burdening every call with an unclear parameter.
2025-11-24 11:05:23 +01:00
Benno Schulenberg
3539d4862e tweaks: add a comment for an unclear fragment of code 2025-11-22 17:39:57 +01:00
Benno Schulenberg
1457013c53 docs: explain what "overlong" means for --breaklonglines
Inspired-by-a-report-from: Sébastien Desreux <seb@h-k.fr>
2025-11-21 16:45:45 +01:00
Benno Schulenberg
c32fdec09f tweaks: slightly improve three comments in the sample nanorc 2025-11-21 12:05:31 +01:00
Benno Schulenberg
3b983dd889 files: include also the slash when re-adding the filename to the path
Otherwise a mistaken name gets recorded in the file-positions history.

Buglet existed since version 6.1, commit fdd946c0.
2025-11-19 11:48:12 +01:00
Benno Schulenberg
71c60563a2 tweaks: reshuffle or transmute a few lines, to elide an 'if' 2025-11-14 10:17:17 +01:00
Benno Schulenberg
fd531c248e po: update translations and regenerate POT file and PO files v8.7 2025-11-12 10:48:25 +01:00
Benno Schulenberg
9735af4d78 bump version numbers and add a news item for the 8.7 release 2025-11-12 08:35:56 +01:00
Benno Schulenberg
88aa9157d1 gnulib: update to its current upstream state 2025-11-11 11:24:21 +01:00
Benno Schulenberg
2593572392 tweaks: improve a few comments, drop one, and unwrap some lines 2025-10-31 10:17:44 +01:00
Benno Schulenberg
e83e1ca4e3 display: regenerate the screen after a resize during a spell check
This refixes https://savannah.gnu.org/bugs/?56033.

This became needed after the previous commit removed the regeneration
of the screen from the blocking/unblocking of SIGWINCHes.
2025-10-29 07:49:56 +01:00
Benno Schulenberg
75ed9e4d55 display: regenerate the screen only before and after waiting for input
Otherwise a SIGWINCH could occur between finalizing the reading of the
specified files and becoming ready for user input, which would result
in the first keystroke getting transformed into the THE_WINDOW_RESIZED
meta symbol, and thus effectively being discarded.

This fixes the third part of https://savannah.gnu.org/bugs/?67635.
The issue was reported by `twofiftysix`.

Buglet has existed for a long time.
2025-10-29 07:49:56 +01:00
Benno Schulenberg
3c129ffded tweaks: reshuffle some #ifdefs, and rename a function 2025-10-29 07:49:56 +01:00
Benno Schulenberg
6136b28af7 startup: register the handler for SIGWINCH much earlier
Otherwise nano is deaf for SIGWINCHes during several milliseconds,
which can cause it to start off with wrong dimensions.

This fixes the second part of https://savannah.gnu.org/bugs/?67635.
The issue was reported, and the solution suggested, by `twofiftysix`.

Buglet has existed for a long time.
2025-10-29 07:48:02 +01:00
Benno Schulenberg
c11569fb99 display: upon resize, redraw the subwindows only when fully initialized
Otherwise 'currmenu' still has an invalid value, causing a division by
zero in bottombars() because shown_entries_for() returns zero.

This fixes the first part of https://savannah.gnu.org/bugs/?67635.
The issue was reported by `twofiftysix`.

Bug existed since version 8.6, commit 09d574ba.
2025-10-28 12:04:04 +01:00
Benno Schulenberg
a23ad70e0e tweaks: improve the punctuation of one item in the sample nanorc 2025-10-27 15:00:33 +01:00
Benno Schulenberg
e1df83c885 build: avoid a warning when configured with --disable-multibuffer 2025-10-26 11:55:10 +01:00
Benno Schulenberg
ffc456ebac docs: add example of copy-to-clipboard-with-OSC52 to the sample nanorc 2025-10-14 11:23:09 +02:00
Benno Schulenberg
4b7ec23db3 new feature: execute a command without capturing the output
The feature is activated by preceding the command with two pipes (||).
This lets the command's output go to the terminal, enabling the user
to implement the OSC52 copy-to-clipboard command with a string bind:

  bind M-* "{execute}|| printf "\033]52;c;%s\007" "$(base64 | tr -d '\n')" {enter}{undo}" main

This keystroke now copies the buffer (or the selected region) to the
local system clipboard, also when nano is running on a remote host --
if and when the used terminal implements the OSC52 command.

Inspired-by: Alessandro Carminati <alessandro.carminati@gmail.com>
2025-10-12 12:50:24 +02:00
Benno Schulenberg
50e186bc81 moving: prevent a negative relative jump from going beyond top of buffer
This fixes https://savannah.gnu.org/bugs/?67581.
Reported-by: Ivan Vorontsov <ivrntsv@yandex.ru>

Bug existed since version 8.6, since relative jumps were introduced.
2025-10-05 12:22:32 +02:00
Benno Schulenberg
3823e8e209 tweaks: unwrap three lines, for esthetics 2025-10-05 12:21:38 +02:00
Benno Schulenberg
f08c0300ce text: when blanking a line due to --autoindent, keep the mark in sync
When Enter is pressed at the end of a line that contains only blanks
while --autoindent is in effect, and thus this line gets emptied, then
the mark should be adjusted accordingly (when somewhere on this line).

This fixes https://savannah.gnu.org/bugs/?67578.
The issue was reported by `correctmost`.

Bug existed since version 2.8.1, commit 005ee8ed, but
became more exposed since version 4.0, commit f7f5514e.
2025-10-05 11:56:18 +02:00
Benno Schulenberg
43f0618f77 tweaks: replace a remaining double dash with a true emdash
Also, avoid a cluster of parentheses by replacing two with an emdash.
2025-09-09 10:34:02 +02:00
Benno Schulenberg
54c7709964 docs: mention that execute can pipe buffer or region to the command
(This should have been part of commit a18b48f0 from seven years ago.)
2025-09-06 16:22:10 +02:00
Benno Schulenberg
326e4146b2 po: update translations and regenerate POT file and PO files v8.6 2025-08-21 08:06:48 +02:00
Benno Schulenberg
fd5900c252 bump version numbers and add a news item for the 8.6 release 2025-08-20 12:44:42 +02:00
Benno Schulenberg
74faba1251 gnulib: update to its current upstream state 2025-08-20 08:37:08 +02:00
Benno Schulenberg
70e580c002 completion: don't stop looking for candidates one byte too early
This fixes https://savannah.gnu.org/bugs/?67405.
Reported-by: Ivan Vorontsov <ivrntsv@yandex.ru>

Bug existed since version 2.7.2, since word completion was introduced.
2025-08-07 15:40:29 +02:00
Benno Schulenberg
1ee74172c2 rcfile: accept also {}} in a string bind, for symmetry with {{} 2025-08-02 09:48:05 +02:00
Benno Schulenberg
121dd596d9 tweaks: swap two symbolic menu names, for giggles 2025-07-10 12:02:14 +02:00
Benno Schulenberg
ea5e199d3b browser: let a refresh also reread the file list, like it used to
Until two commits ago, a full refresh (^L) would first refresh the
screen and then reread the file list and redo the screen again.
Now it will just reread the list and redo the screen, skipping the
redundant refresh.  The latter is done only for the tiny version.

Also rename a label, to be more precise.
2025-07-10 10:04:39 +02:00
Benno Schulenberg
e7c28bcb66 browser: redo the layout only when an actual resize occurred
This improves upon the previous commit.

This fixes https://savannah.gnu.org/bugs/?67294 in a better way.
2025-07-10 09:49:45 +02:00
Benno Schulenberg
21207b47a0 browser: redo the layout when the window _might_ have resized
The user may have resized the window not only while in the help viewer
but also while at the Search or Goto prompt.  Ensure that after all of
them the browser rebuilds the list according to the current dimensions.

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

Bug existed since version 2.5.3, commit 813f9f72.
2025-07-09 16:07:45 +02:00
Benno Schulenberg
09d574bae9 display: when resizing, redraw the bottom bars also when in file browser
This fixes https://savannah.gnu.org/bugs/?67293.

Bug existed since version 8.2, commit fe0b928b.
2025-07-09 11:37:18 +02:00
Benno Schulenberg
b68d74effc syntax: po: colorize also the %b and %B format specifiers
Glibc's printf() recognizes these specifiers since version 2.35:
  https://sourceware.org/pipermail/libc-announce/2022/000033.html
2025-07-08 16:05:25 +02:00
Benno Schulenberg
88309f981a tweaks: put two related checks together, like they are elsewhere 2025-07-06 15:01:26 +02:00