]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(doc): clarify the use of change marks when writing a buffer
authorChristian Brabandt <cb@256bit.org>
Thu, 3 Apr 2025 10:33:02 +0000 (12:33 +0200)
committerChristian Brabandt <cb@256bit.org>
Thu, 3 Apr 2025 10:35:51 +0000 (12:35 +0200)
related: #17008

Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/doc/autocmd.txt
runtime/doc/change.txt
runtime/doc/editing.txt
runtime/doc/motion.txt

index 372d1acbc34f1dd0ffdb4323a9f7b9561122e52c..820c302608de83d446efb6358a9b086b40821e22 100644 (file)
@@ -1,4 +1,4 @@
-*autocmd.txt*   For Vim version 9.1.  Last change: 2025 Mar 12
+*autocmd.txt*   For Vim version 9.1.  Last change: 2025 Apr 03
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -593,7 +593,8 @@ BufWriteCmd                 Before writing the whole buffer to a file.
                                The buffer contents should not be changed.
                                When the command resets 'modified' the undo
                                information is adjusted to mark older undo
-                               states as 'modified', like |:write| does.
+                               states as 'modified', like |:write| does.  Use
+                               the |'[| and |']| marks for the range of lines.
                                |Cmd-event|
                                                        *BufWritePost*
 BufWritePost                   After writing the whole buffer to a file
@@ -886,14 +887,14 @@ FileType                  When the 'filetype' option has been set.  The
 FileWriteCmd                   Before writing to a file, when not writing the
                                whole buffer.  Should do the writing to the
                                file.  Should not change the buffer.  Use the
-                               '[ and '] marks for the range of lines.
+                               |'[| and |']| marks for the range of lines.
                                |Cmd-event|
                                                        *FileWritePost*
 FileWritePost                  After writing to a file, when not writing the
                                whole buffer.
                                                        *FileWritePre*
 FileWritePre                   Before writing to a file, when not writing the
-                               whole buffer.  Use the '[ and '] marks for the
+                               whole buffer.  Use the |'[| and |']| marks for the
                                range of lines.
                                                        *FilterReadPost*
 FilterReadPost                 After reading a file from a filter command.
index c656a117c3c8e0b112e61a478a208d5f1995b9df..24137c74dba0d8e621c6d5c8f4c0579053c42d52 100644 (file)
@@ -1,4 +1,4 @@
-*change.txt*    For Vim version 9.1.  Last change: 2025 Mar 18
+*change.txt*    For Vim version 9.1.  Last change: 2025 Apr 03
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -156,8 +156,8 @@ only after a '.').
 The 'B' and 'M' flags in 'formatoptions' change the behavior for inserting
 spaces before and after a multibyte character |fo-table|.
 
-The '[ mark is set at the end of the first line that was joined, '] at the end
-of the resulting line.
+The |'[| mark is set at the end of the first line that was joined, |']| at the
+end of the resulting line.
 
 
 ==============================================================================
@@ -1188,8 +1188,8 @@ the ":put" command, Vim always inserts the text in the next line.  You can
 exchange two characters with the command sequence "xp".  You can exchange two
 lines with the command sequence "ddp".  You can exchange two words with the
 command sequence "deep" (start with the cursor in the blank space before the
-first word).  You can use the "']" or "`]" command after the put command to
-move the cursor to the end of the inserted text, or use "'[" or "`[" to move
+first word).  You can use the |']| or |`]| command after the put command to
+move the cursor to the end of the inserted text, or use |'[| or |`[| to move
 the cursor to the start.
 
                                                *put-Visual-mode* *v_p* *v_P*
index a70515d6ff2f90e4c98dc72b32a303fe51e63194..a88aad1a7fa4eefb3ca71da5f7bca6689a075ac1 100644 (file)
@@ -1,4 +1,4 @@
-*editing.txt*   For Vim version 9.1.  Last change: 2024 Oct 14
+*editing.txt*   For Vim version 9.1.  Last change: 2025 Apr 03
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -974,8 +974,9 @@ Note: When the 'write' option is off, you are not able to write any file.
                        executed like with ":!{cmd}", any '!' is replaced with
                        the previous command |:!|.
 
-The default [range] for the ":w" command is the whole buffer (1,$).  If you
-write the whole buffer, it is no longer considered changed.  When you
+The default [range] for the ":w" command is the whole buffer (1,$).  The |'[|
+and |']| marks will be set to the [range] being used for the write command.
+If you write the whole buffer, it is no longer considered changed.  When you
 write it to a different file with ":w somefile" it depends on the "+" flag in
 'cpoptions'.  When included, the write command will reset the 'modified' flag,
 even though the buffer itself may still be different from its file.
index 4e57797a54c0b476e5d5c8cbba3206633a7ff127..726d15ddeabf7ff847ce4bb94ad973754e62bca9 100644 (file)
@@ -1,4 +1,4 @@
-*motion.txt*    For Vim version 9.1.  Last change: 2024 Dec 17
+*motion.txt*    For Vim version 9.1.  Last change: 2025 Apr 03
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -895,12 +895,12 @@ Numbered mark should be stored.  See |viminfo-file-marks|.
 
 
                                                        *'[* *`[*
-'[  `[                 To the first character of the previously changed
-                       or yanked text.
+'[  `[                 To the first character of the previously changed,
+                       or yanked text.  Also set when writing the buffer.
 
                                                        *']* *`]*
 ']  `]                 To the last character of the previously changed or
-                       yanked text.
+                       yanked text.  Also set when writing the buffer.
 
 After executing an operator the Cursor is put at the beginning of the text
 that was operated upon.  After a put command ("p" or "P") the cursor is