Re: Feature Request: Enabling opening files externally at a particular line number



On 25 March 2013 06:26, Konstantin <starojitski gmail com> wrote:
Hi all,

Thanks for your feedback. I decided to quickly learn some python and
implement this feature myself in the way you suggested. Attached are three
diff (patch) files.
Now you can use $file and $line words in the editor command text box. For
example:

sublime_text $file:$line
or
C:\PROGRA~1\ConTEXT\context.exe /g0:$line $file

if you don't provide $file than everything after the first space is ignored

I am sure there is plenty space for improvement therefore i am looking
forward to your comments.

Thanks for having a go! I think it's probably going to be a bit more
complicated, but this is a good start.

In FileDiff, we can't just use self.cursor; we'll have to get the
cursor line from the buffer pane from which the file is being opened.
In MeldDoc, we shouldn't do any additional processing on commands
retrieved from desktop defaults. I think the easiest way around this
is to put the pattern processing into get_editor_command itself.

Finally, I'm not sure what to do about the keywords. While part of me
wants to use desktop-file-style %-format specifiers, I think that
using Python 2.6 format specifications is really the only sane option,
particularly since all the sanity parsing is already done for us. What
do you think about supporting something like "sublime {file}:{line}"
instead?

I have not changed the preferences dialog yet but will do it shortly.

I'm not sure that the preferences dialog needs changing; adding
details about the tokens and such to the documentation should be fine.

cheers,
Kai


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]