Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Improve editor command line arguments #34
Instead of assuming the command line arguments are fit for opening in a particular line and column, we now translate based on the command line.
The only proper way would be to include information on how each editor needs its arguments.
If the editor is unknown, we simply use the editor parameter with the filename, which is the only likely thing to at least work:
If we were to try to also introduce the line and column numbers, it is more likely to fail than succeed because each editor parses command line differently.
A problem that still needs to be addressed is the usage of
These are different and should not be mixed together. It would likely require some more subtle logic in Critique.pm, hopefully removing the
This small bit includes a test. It is not numbered because I don't see the point of numbering tests.
I think the mistake is that we had two implementations. @roman-alexeev and I should have coordinated.
Mine splits the logic to a separate file and has two hashes: One for translation of each editor (allowing to easily add more) and one for resolving aliases of editors (like
The other implementation does the translation in the configuration resolution step.
The other implementation fails for
They both work so it doesn't matter which you take.