summaryrefslogtreecommitdiffstats
path: root/runtime/doc
diff options
context:
space:
mode:
authorShougo Matsushita <Shougo.Matsu@gmail.com>2024-06-03 22:59:27 +0200
committerChristian Brabandt <cb@256bit.org>2024-06-03 23:01:40 +0200
commit60c8743ab6c90e402e6ed49d27455ef7e5698abe (patch)
tree441cc398a542d10a60cd9c1dd7862ebcf0f1353e /runtime/doc
parent0a0830624a260660c7fa692ecb7e6e5de09114ba (diff)
patch 9.1.0465: missing filecopy() functionv9.1.0465
Problem: missing filecopy() function Solution: implement filecopy() Vim script function (Shougo Matsushita) closes: #12346 Co-authored-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/builtin.txt16
-rw-r--r--runtime/doc/tags1
-rw-r--r--runtime/doc/todo.txt5
-rw-r--r--runtime/doc/usr_41.txt3
-rw-r--r--runtime/doc/version9.txt7
5 files changed, 23 insertions, 9 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 751fbc2156..782c42f74a 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -1,4 +1,4 @@
-*builtin.txt* For Vim version 9.1. Last change: 2024 May 25
+*builtin.txt* For Vim version 9.1. Last change: 2024 Jun 03
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -178,6 +178,8 @@ extendnew({expr1}, {expr2} [, {expr3}])
List/Dict like |extend()| but creates a new
List or Dictionary
feedkeys({string} [, {mode}]) Number add key sequence to typeahead buffer
+filecopy({from}, {to}) Number |TRUE| if copying file {from} to {to}
+ worked
filereadable({file}) Number |TRUE| if {file} is a readable file
filewritable({file}) Number |TRUE| if {file} is a writable file
filter({expr1}, {expr2}) List/Dict/Blob/String
@@ -2757,6 +2759,18 @@ feedkeys({string} [, {mode}]) *feedkeys()*
Can also be used as a |method|: >
GetInput()->feedkeys()
+filecopy({from}, {to}) *filecopy()*
+ Copy the file pointed to by the name {from} to {to}. The
+ result is a Number, which is |TRUE| if the file was copied
+ successfully, and |FALSE| when it failed.
+ If a file with name {to} already exists, it will fail.
+ Note that it does not handle directories (yet).
+
+ This function is not available in the |sandbox|.
+
+ Can also be used as a |method|: >
+ GetOldName()->filecopy(newname)
+
filereadable({file}) *filereadable()*
The result is a Number, which is |TRUE| when a file with the
name {file} exists, and can be read. If {file} doesn't exist,
diff --git a/runtime/doc/tags b/runtime/doc/tags
index 73aefe1cef..75c27f928d 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -7091,6 +7091,7 @@ file-searching editing.txt /*file-searching*
file-type filetype.txt /*file-type*
file-types filetype.txt /*file-types*
file_readable() builtin.txt /*file_readable()*
+filecopy() builtin.txt /*filecopy()*
fileencoding-changed version6.txt /*fileencoding-changed*
filename-backslash cmdline.txt /*filename-backslash*
filename-modifiers cmdline.txt /*filename-modifiers*
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index 7491b06e0f..c37a1d4bd1 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt* For Vim version 9.1. Last change: 2024 May 11
+*todo.txt* For Vim version 9.1. Last change: 2024 Jun 03
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -82,8 +82,6 @@ With 'smoothscroll' set and "lastline" in 'display', moving the cursor to a
wrapping line that makes the display scroll up may scroll much more than
needed, thus jump-scrolling. (part of issue 12411)
-Add filecopy() ? #12346
-
Implement foreach() PR #12166
Errors when running tests with valgrind:
@@ -4242,7 +4240,6 @@ Vim script language:
base64enc() base 64 encoding
base64dec() base 64 decoding
attributes() return file protection flags "drwxrwxrwx"
- filecopy(from, to) Copy a file
shorten(fname) shorten a file name, like home_replace()
perl(cmd) call Perl and return string
inputrl() like input() but right-to-left
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
index 26651ebb16..4225d1f621 100644
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -1,4 +1,4 @@
-*usr_41.txt* For Vim version 9.1. Last change: 2024 May 07
+*usr_41.txt* For Vim version 9.1. Last change: 2024 Jun 03
VIM USER MANUAL - by Bram Moolenaar
@@ -993,6 +993,7 @@ System functions and manipulation of files:
readdir() get a List of file names in a directory
readdirex() get a List of file information in a directory
writefile() write a List of lines or Blob into a file
+ filecopy() copy a file {from} to {to}
Date and Time: *date-functions* *time-functions*
getftime() get last modification time of a file
diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt
index 3fe8b2dad0..07c416ae28 100644
--- a/runtime/doc/version9.txt
+++ b/runtime/doc/version9.txt
@@ -41576,11 +41576,12 @@ Various syntax, indent and other plugins were added.
Functions: ~
|diff()| diff two Lists of strings
+|filecopy()| copy a file {from} to {to}
|foreach()| apply function to List items
-|matchbufline()| all the matches of a pattern in a buffer
-|matchstrlist()| all the matches of a pattern in a List of strings
|getregion()| get a region of text from a buffer
|getregionpos()| get a list of positions for a region
+|matchbufline()| all the matches of a pattern in a buffer
+|matchstrlist()| all the matches of a pattern in a List of strings
Autocommands: ~
@@ -41607,7 +41608,7 @@ Options: ~
't_CF' Support for alternate font highlighting terminal code
==============================================================================
-INCOMPATIBLE CHANGES *incompatible-9.2*
+INCOMPATIBLE CHANGES *incompatible-9.2*
Improved/Different MS-Windows mapping support
|w32-experimental-keycode-trans-strategy|