Neovim plugin.The best code runner you could have, it is like the one in vscode but with super powers, it manages projects like in intellij but without being slow
Currently some project paths cannot be recognized because they contain
characters that the string.find function thinks are part of a pattern.
An example would be /tmp/my-project as it contains a - (non-greedy
match). Escaping the - with %- will result in an error when the
command wants to change the directory or wants to find a file in the
directory.
Minor change:
For clarity I renamed the variable path to file_path and fixed a
typo in current_proyect to current_project.
To allow for pattern matching in the keys of the table project,
current_project.path needs to be set to the match instead of the key
itself.
Due to the vim.fs.normalize that expands environment variables, ~,
etc. the last / will be stripped from the pattern. This will lead to
potentially incomplete matches.
If your pattern is .*terraform%-.-/ to match /path/to/terrafrom-prod
and /path/to/terraform-dev, your command will fail because the path
will yield only /path/to/terraform- thus not being able to find the
directory (eventhough the pattern tries to end with /).
To combat this — bit of a hack — you can append .- to retain the last
/.
The pattern then would be .*terrafrom%-.-/.-:
.* greedily match everything
terraform literal terrafrom
%- matches - because it needs to be escaped with %
.- non-greedily match everything
/ literal /
.- matches nothing (since it is non-greedy) and is only there to
prevent / from being stripped
Currently some project paths cannot be recognized because they contain characters that the
string.find
function thinks are part of a pattern. An example would be/tmp/my-project
as it contains a-
(non-greedy match). Escaping the-
with%-
will result in an error when the command wants to change the directory or wants to find a file in the directory.Minor change: For clarity I renamed the variable
path
tofile_path
and fixed a typo incurrent_proyect
tocurrent_project
.To allow for pattern matching in the keys of the table
project
,current_project.path
needs to be set to the match instead of the key itself.Due to the
vim.fs.normalize
that expands environment variables,~
, etc. the last/
will be stripped from the pattern. This will lead to potentially incomplete matches. If your pattern is.*terraform%-.-/
to match/path/to/terrafrom-prod
and/path/to/terraform-dev
, your command will fail because the path will yield only/path/to/terraform-
thus not being able to find the directory (eventhough the pattern tries to end with/
).To combat this — bit of a hack — you can append
.-
to retain the last/
.The pattern then would be
.*terrafrom%-.-/.-
:.*
greedily match everythingterraform
literalterrafrom
%-
matches-
because it needs to be escaped with%
.-
non-greedily match everything/
literal/
.-
matches nothing (since it is non-greedy) and is only there to prevent/
from being strippedFixes #94