Other resources xulit.org | Blog | Donate

What is ViewSourceWith

ViewSourceWith is an addon compatible with many mozilla applications.

The main goal allows users to open (and in some cases edit) page source with external applications but you can also...


Read more »

A brief survey

The figure below shows a tipical javascript console error/warning list.
If user clicks on links Firefox (or Thunderbird or Flock and so on) opens the default editor and moves the cursor to the corresponding line shown on the right of the row (based on figure the line number 99).


Using ViewSourceWith inside javascript console

Now VSW has the ability to open files when user click on javascript console links.
This doens't require any special behaviour, if user settings allow to replace native editor inside javascript console the default editor is used.



Moving cursor to correct line number

The problem is how to say to editor used by ViewSourceWith to scroll to a specific line number?
This must be done when the editor is defined

You must use the $l parameter (lowercase el).
When editor is called this parameter is replaced by the line number (e.g. 99).

BUT this is not sufficient!!

You must use the command line switch specific for your preferred editor to move cursor.
Below you find some command lines to use with ViewSourceWith

Editor Command line
UltraEdit $f -l$l
notepad++ $f -n$l
VIM $f +$l
Emacs $f +$l