diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2024-09-26 15:53:45 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2024-09-26 15:53:45 +0200 |
| commit | 3c458c6710ab77d6ec34f051de77435db9ccc089 (patch) | |
| tree | a76c4b307ab3445e0c3ecd2c9688a56f198f0d8f /README.md | |
| parent | 7e1eceeb9c8cc191ea6d84f47ee3064e1dad8610 (diff) | |
| download | vis-open-extend-3c458c6710ab77d6ec34f051de77435db9ccc089.tar.gz vis-open-extend-3c458c6710ab77d6ec34f051de77435db9ccc089.zip | |
allow proper transparent WIN_OPEN event handling
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.
Diffstat (limited to 'README.md')
0 files changed, 0 insertions, 0 deletions
