orbitalquark / textadept

Textadept is a fast, minimalist, and remarkably extensible cross-platform text editor for programmers.
https://orbitalquark.github.io/textadept
MIT License
636 stars 38 forks source link

Fossil repository is not recognized as a project #436

Closed kenpel closed 1 year ago

kenpel commented 1 year ago

Hi. As per the subject line, the Fossil repository is not recognized as a project, Language Server will not start.

I was able to solve the problem by myself, but I do not know how to contribute, here is the patch.

*** file_io.lua 2023-08-04 21:06:09.329496505 +0900
--- file_io.lua.new 2023-08-04 20:29:27.471727626 +0900
***************
*** 346,352 ****
    while dir do
        for i = 1, #vcs do
            local mode = lfs.attributes(dir .. '/' .. vcs[i], 'mode')
!           if mode and (submodule or mode == 'directory') then return dir end
        end
        dir = dir:match('^(.+)[/\\]')
    end
--- 346,352 ----
    while dir do
        for i = 1, #vcs do
            local mode = lfs.attributes(dir .. '/' .. vcs[i], 'mode')
!           if mode and (submodule or mode == 'directory' or mode == 'file') then return dir end
        end
        dir = dir:match('^(.+)[/\\]')
    end

_FOSSIL_ is a file, not a directory.

orbitalquark commented 1 year ago

Thanks for the report. This should be fixed via https://github.com/orbitalquark/textadept/commit/f08b6c3314072b3e68be95ee0fc78dd05ac8ec26 and will be in the next nightly build. Your proposed fix breaks git projects with submodules -- the submodules will always be recognized as project roots, which is not always desirable.