-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert "core syntax: strip the path from filename on syntax.get (#1168)" #1322
Revert "core syntax: strip the path from filename on syntax.get (#1168)" #1322
Conversation
Instead of simply reverting could you add the two checks? One with path and another without, because other syntax files where failing with the full path. |
The correct way would be to fix the syntaxes to use |
The only issue would be with files in the actual root of the project. We could:
|
Actually, do we care about testing if something is in the project root? For example the ssh syntax would match the config file even if the project root is the |
eabdc74
to
2d220c5
Compare
With the last commit, we match the entire path if possible. We now also use |
But can we keep support for |
I think having it matching just absolute paths makes the most sense, as opposed to matching multiple things. |
Yes, replace |
At least that list serves as reference, don't forget to contact the owner of https://github.com/FilBot3/lite-xl-language-containerfile/blob/main/init.lua to apply the change |
This allows matching full paths in language syntaxes, but we lose the possibility of matching the project root.
2d220c5
to
7b99c00
Compare
Looks good, adjusted plugins on the 2.2 branch for plugins, and pushed. Merging. |
…-xl#1168)" (lite-xl#1322) * Revert "core syntax: strip the path from filename on syntax.get (lite-xl#1168)" This reverts commit af6c4bc. The previous behavior was correct and allowed access to the full path for path-dependant syntaxes. * Use `Doc.abs_filename` to obtain syntax when possible This allows matching full paths in language syntaxes, but we lose the possibility of matching the project root.
…-xl#1168)" (lite-xl#1322) * Revert "core syntax: strip the path from filename on syntax.get (lite-xl#1168)" This reverts commit af6c4bc. The previous behavior was correct and allowed access to the full path for path-dependant syntaxes. * Use `Doc.abs_filename` to obtain syntax when possible This allows matching full paths in language syntaxes, but we lose the possibility of matching the project root.
…-xl#1168)" (lite-xl#1322) * Revert "core syntax: strip the path from filename on syntax.get (lite-xl#1168)" This reverts commit af6c4bc. The previous behavior was correct and allowed access to the full path for path-dependant syntaxes. * Use `Doc.abs_filename` to obtain syntax when possible This allows matching full paths in language syntaxes, but we lose the possibility of matching the project root.
This reverts commit af6c4bc.
The previous behavior was correct and allowed access to the full path for path-dependant syntaxes.
The correct way to do filename-only matching is prepending the match with the path separator.
Would need testing on Windows to see whether it's necessary to use
[\\/]
, or if/
is enough.The syntaxes that used
^
will have to switch to/
.