diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2025-01-11 15:11:16 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-01-11 15:11:16 +0100 |
| commit | 29afc301ea05bc907444b698c91b141c26167baa (patch) | |
| tree | 63141257deab54705be8c937ef7f1c0b95b7512d /util.lua | |
| parent | f04bb93e982060ed27e5cf6e4a8d97edeb0910b6 (diff) | |
| download | vis-lspc-29afc301ea05bc907444b698c91b141c26167baa.tar.gz vis-lspc-29afc301ea05bc907444b698c91b141c26167baa.zip | |
make universal root detection opt-in
Diffstat (limited to 'util.lua')
| -rw-r--r-- | util.lua | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -123,6 +123,13 @@ function util.get_relative_path(cwd_components, absolute_path_or_components) return dir:sub(2) end +--- Strip the last component from a pathname +-- @param the pathname +-- @return the pathname up to the last '/' +function util.dirname(name) + return name:match('(.*[/])') +end + --- Create an iterator yielding the nth line of a file -- -- @param path The path to the file |
