Closed YodaEmbedding closed 1 year ago
When filename_first = false
, the highlighting is 1 character too long:
Fixed in https://github.com/danielfalk/smart-open.nvim/pull/37/commits/733b8e339490cf00b63ab74fe244f593fc084486. Note that the filename_first = true
was also 1 character too long, though it wasn't as noticeable.
The search highlighting for filename_first = false
isn't working properly for directories, though.
Correct (except for tests/utils.py):
Incorrect:
The first word is incorrectly highlighted. I wonder if that's because the highlighting logic was expecting a string in the format filename path/to/dir
... Actually, yeah, look: scripTS
, resulTS.py
, comprESsai_trainer/...
all occur on the fifth character, so two of them are linked in some way.
Good work first of all. I was able to try it out. There is just one remaining thing I noticed. With filename_first = true
, there is no leading slash for files in the base directory, but for filename_first = false
, I'm seeing that:
(should just be stylua.toml
, not /stylua.toml
)
I think that the path formatters may need more tweaking. For instance, given the directory tree:
~/cwd/
├── cwd
│ ├── init.lua
│ └── not_an_init.txt
├── init.lua
└── not_an_init.txt
And if cwd = ~/cwd
, then we get:
Notice that ~/cwd/init.lua
is formatted a bit unusually in both cases and may be confused with ~/cwd/cwd/init.lua
. Perhaps better is:
cwd/init.lua (for ~/cwd/cwd/init.lua)
init.lua (for ~/cwd/init.lua)
But that's probably outside the scope of this PR.
Looks good. Thanks!
The code looks right, but I don't have time to test this yet. I'm particularly concerned with the highlighting. Does it look OK in all circumstances?