diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-08-06 20:49:59 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-06 12:49:59 +0000 |
commit | 28fbba2092adb9659253434605cb94252241f5e0 (patch) | |
tree | e7665e98c3c87f3b57ab348d143da98196efdfcc /src/nvim/eval.lua | |
parent | b5f92c4e5c7428fe1c1f91620f4b545b30b49855 (diff) | |
download | rneovim-28fbba2092adb9659253434605cb94252241f5e0.tar.gz rneovim-28fbba2092adb9659253434605cb94252241f5e0.tar.bz2 rneovim-28fbba2092adb9659253434605cb94252241f5e0.zip |
vim-patch:9.1.0465: missing filecopy() function (#29989)
Problem: missing filecopy() function
Solution: implement filecopy() Vim script function
(Shougo Matsushita)
closes: vim/vim#12346
https://github.com/vim/vim/commit/60c8743ab6c90e402e6ed49d27455ef7e5698abe
Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Diffstat (limited to 'src/nvim/eval.lua')
-rw-r--r-- | src/nvim/eval.lua | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index 4bb82e5b3e..430ee20081 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -2521,6 +2521,23 @@ M.funcs = { params = { { 'file', 'string' } }, signature = 'file_readable({file})', }, + filecopy = { + args = 2, + base = 1, + desc = [[ + 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|. + ]], + name = 'filecopy', + params = { { 'from', 'string' }, { 'to', 'string' } }, + returns = '0|1', + signature = 'filecopy({from}, {to})', + }, filereadable = { args = 1, base = 1, |