diff options
author | 2019-01-31 13:16:18 -0500 | |
---|---|---|
committer | 2019-01-31 13:16:18 -0500 | |
commit | 422b18985b763758077c4e42b733b5a5ba100288 (patch) | |
tree | 179e6553f38bff64b1d8fbecc03cebe3e21ff3b7 | |
parent | 86d03dc4dff7e3a86eb5b549f8cf9f94efce4275 (diff) | |
download | textadept-422b18985b763758077c4e42b733b5a5ba100288.tar.gz textadept-422b18985b763758077c4e42b733b5a5ba100288.zip |
Do not limit version control markers to directories.
At least git allows files named '.git'.
-rw-r--r-- | core/file_io.lua | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/core/file_io.lua b/core/file_io.lua index d976d84a..820bf70a 100644 --- a/core/file_io.lua +++ b/core/file_io.lua @@ -362,9 +362,7 @@ function io.get_project_root(path) local dir = path or (buffer.filename or lfs.currentdir()):match('^(.+)[/\\]') while dir do for i = 1, #vcs do - if lfs_attributes(dir..'/'..vcs[i], 'mode') == 'directory' then - return dir - end + if lfs_attributes(dir..'/'..vcs[i], 'mode') then return dir end end dir = dir:match('^(.+)[/\\]') end |