| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Simply changing the file in a single WIN_OPEN event has one of two
possible problems.
1. Problem: We keep the current window
Then all previously ran WIN_OPEN event handlers have observed a wrong
file path, leading to broken syntax highlighting for example.
2. Problem: Use a new window
This solves the 1. Problem by emitting a new WIN_OPEN event with
the correct file path. However, this leads to plugins like vis-cursors
to jump to a possibly different line rendering vis-open-extend useless.
The solution to both problems is to split our event handling in two
parts:
On the original event detect the file and the specified line.
Change to the file in a new window, remember the line and stop
the event handling for the first event.
On the second WIN_OPEN event for the correct file path simply
jump to the remembered line.
This allows both plugins vis-open-extend and vis-cursors to work,
if vis-open-extend is loaded after vis-cursors, so our event handler
runs after the one from vis-cursors.
|