Home Download Buy Blog Forum Support

on_load induced by preview in goto anything

on_load induced by preview in goto anything

Postby xeno.by on Sat Aug 18, 2012 12:18 am

Is it possible to distinguish it from an "honest" on_load that happens when a file is opened for real?

In my plugin I want to typecheck loaded files, so that the user instantly gets error highlighting and other good stuff. It's usually 1-2s of background work, so it's not a problem at all.

Except when I use goto anything. Then simply typing a name of the file I want might produce a bunch of file previews, each of them potentially triggering a typecheck. Now that might be a problem.
xeno.by
 
Posts: 106
Joined: Mon Jan 30, 2012 10:03 am
Location: Lausanne, Switzerland

Re: on_load induced by preview in goto anything

Postby xeno.by on Wed Aug 22, 2012 6:32 pm

It looks like when previewed with Go to Anything, a view first gets on_activated with v.file_name() equal to None and then on_load.

To the contrast when opened normally, a view first triggers on_load and then on_activated with a non-empty name.
xeno.by
 
Posts: 106
Joined: Mon Jan 30, 2012 10:03 am
Location: Lausanne, Switzerland


Return to Plugin Development

Who is online

Users browsing this forum: Yahoo [Bot] and 4 guests