commit 88776e0eee06560970aa199231a268a852d8d6a1
parent 9be62a69649f12bfe379fa8b0bb0bc7650b857cd
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sat, 17 May 2025 12:12:56 +0200
docs: mention that --positionlog also saves the positions of anchors
Diffstat:
4 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/doc/nano.1 b/doc/nano.1
@@ -180,6 +180,7 @@ beginning of a paragraph (unless auto-indenting is on).
.BR \-P ", " \-\-positionlog
For the 200 most recent files, log the last position of the cursor,
and place it at that position again upon reopening such a file.
+Also save and restore the positions of any anchors.
.TP
.BI "\-Q """ regex\fB"\fR, " \-\-quotestr=""" regex """"
Set the regular expression for matching the quoting part of a line.
diff --git a/doc/nano.texi b/doc/nano.texi
@@ -350,18 +350,22 @@ is running.
@node Anchors
@section Anchors
-With @kbd{M-Ins} you can place an anchor (a kind of temporary bookmark)
-at the current line. With @kbd{M-PgUp} and @kbd{M-PgDn} you can jump
+With @kbd{M-Ins} you can place an anchor (a kind of bookmark) at
+the current line. With @kbd{M-PgUp} and @kbd{M-PgDn} you can jump
to an anchor in the backward/forward direction. This jumping wraps
around at the top and bottom.
-When a line with an anchor is removed, the line where the cursor ends up
-inherits the anchor. After performing an operation on the entire buffer
-(like formatting it, piping it through a command, or doing an external
-spell check on it), any anchors that were present are gone. And when
-you close the buffer, all its anchors simply disappear; they are not saved.
+When an operation removes a line with an anchor, the new line with the
+cursor inherits the anchor. But after performing an operation on the
+entire buffer (like formatting it, piping it through a command, or
+doing an external spell check on it), any anchors that were present
+are gone.
-Anchors are visualized in the margin when line numbers are activated.
+When @option{--positionlog} or @code{set positionlog} is active, anchors
+are saved when the file is closed, and restored when the file is reopened.
+
+Anchors are visualized in the left margin if line numbers are active,
+and are always visualized (on the right-hand side) in the mini bar.
@node Limitations
@section Limitations
@@ -494,6 +498,7 @@ beginning of a paragraph (unless auto-indenting is on).
@itemx --positionlog
For the 200 most recent files, log the last position of the cursor,
and place it at that position again upon reopening such a file.
+Also save and restore the positions of any anchors.
@item -Q "@var{regex}"
@itemx --quotestr="@var{regex}"
@@ -1102,8 +1107,8 @@ files are inserted from this directory. By default, the operating
directory feature is turned off.
@item set positionlog
-Save the cursor position of files between editing sessions.
-The cursor position is remembered for the 200 most-recently edited files.
+Save the positions of cursor and anchors between editing sessions.
+These positions are remembered for the 200 most-recently edited files.
@item set preserve
Preserve the XOFF and XON sequences (@kbd{^S} and @kbd{^Q}) so that
diff --git a/doc/nanorc.5 b/doc/nanorc.5
@@ -256,8 +256,8 @@ files are inserted from this directory. By default, the operating
directory feature is turned off.
.TP
.B set positionlog
-Save the cursor position of files between editing sessions.
-The cursor position is remembered for the 200 most-recently edited files.
+Save the positions of cursor and anchors between editing sessions.
+These positions are remembered for the 200 most-recently edited files.
.TP
.B set preserve
Preserve the XOFF and XON sequences (\fB^S\fR and \fB^Q\fR) so that
diff --git a/doc/sample.nanorc.in b/doc/sample.nanorc.in
@@ -126,7 +126,7 @@
## string means the operating-directory feature is turned off.
# set operatingdir ""
-## Remember the cursor position in each file for the next editing session.
+## Remember the position of cursor and anchors for the next editing session.
# set positionlog
## Preserve the XON and XOFF keys (^Q and ^S).