Mercurial > vim
comparison runtime/doc/builtin.txt @ 28629:5ef46b938c6e v8.2.4838
patch 8.2.4838: checking for absolute path is not trivial
Commit: https://github.com/vim/vim/commit/dca1d40cd0f2af0755519e7028378bd3c8fefd31
Author: LemonBoy <thatlemon@gmail.com>
Date: Thu Apr 28 15:26:33 2022 +0100
patch 8.2.4838: checking for absolute path is not trivial
Problem: Checking for absolute path is not trivial.
Solution: Add isabsolutepath(). (closes https://github.com/vim/vim/issues/10303)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 28 Apr 2022 16:30:03 +0200 |
parents | 4d76b3e07c07 |
children | e4de5b5193b4 |
comparison
equal
deleted
inserted
replaced
28628:5cb27da6a351 | 28629:5ef46b938c6e |
---|---|
293 inputsave() Number save and clear typeahead | 293 inputsave() Number save and clear typeahead |
294 inputsecret({prompt} [, {text}]) String like input() but hiding the text | 294 inputsecret({prompt} [, {text}]) String like input() but hiding the text |
295 insert({object}, {item} [, {idx}]) List insert {item} in {object} [before {idx}] | 295 insert({object}, {item} [, {idx}]) List insert {item} in {object} [before {idx}] |
296 interrupt() none interrupt script execution | 296 interrupt() none interrupt script execution |
297 invert({expr}) Number bitwise invert | 297 invert({expr}) Number bitwise invert |
298 isabsolutepath({path}) Number |TRUE| if {path} is an absolute path | |
298 isdirectory({directory}) Number |TRUE| if {directory} is a directory | 299 isdirectory({directory}) Number |TRUE| if {directory} is a directory |
299 isinf({expr}) Number determine if {expr} is infinity value | 300 isinf({expr}) Number determine if {expr} is infinity value |
300 (positive or negative) | 301 (positive or negative) |
301 islocked({expr}) Number |TRUE| if {expr} is locked | 302 islocked({expr}) Number |TRUE| if {expr} is locked |
302 isnan({expr}) Number |TRUE| if {expr} is NaN | 303 isnan({expr}) Number |TRUE| if {expr} is NaN |
4670 List, Dict or Float argument causes an error. Example: > | 4671 List, Dict or Float argument causes an error. Example: > |
4671 :let bits = invert(bits) | 4672 :let bits = invert(bits) |
4672 < Can also be used as a |method|: > | 4673 < Can also be used as a |method|: > |
4673 :let bits = bits->invert() | 4674 :let bits = bits->invert() |
4674 | 4675 |
4676 isabsolutepath({directory}) *isabsolutepath()* | |
4677 The result is a Number, which is |TRUE| when {path} is an | |
4678 absolute path. | |
4679 < On Unix, a path is considered absolute when it starts with '/'. | |
4680 On MS-Windows, it is considered absolute when it starts with an | |
4681 optional drive prefix and is followed by a '\' or '/'. UNC paths | |
4682 are always absolute. | |
4683 Example: > | |
4684 echo isabsolutepath('/usr/share/') " 1 | |
4685 echo isabsolutepath('./foobar') " 0 | |
4686 echo isabsolutepath('C:\Windows') " 1 | |
4687 echo isabsolutepath('foobar') " 0 | |
4688 echo isabsolutepath('\\remote\file') " 1 | |
4689 | |
4690 Can also be used as a |method|: > | |
4691 GetName()->isabsolutepath() | |
4692 | |
4693 | |
4675 isdirectory({directory}) *isdirectory()* | 4694 isdirectory({directory}) *isdirectory()* |
4676 The result is a Number, which is |TRUE| when a directory | 4695 The result is a Number, which is |TRUE| when a directory |
4677 with the name {directory} exists. If {directory} doesn't | 4696 with the name {directory} exists. If {directory} doesn't |
4678 exist, or isn't a directory, the result is |FALSE|. {directory} | 4697 exist, or isn't a directory, the result is |FALSE|. {directory} |
4679 is any expression, which is used as a String. | 4698 is any expression, which is used as a String. |