It seems that that simple patch do the trick (Preview is rendered on Instant
Preview -> On OR No math..)
On Sun, Sep 19, 2010 at 3:48 AM, Pavel Sanda <[email protected]> wrote:
> Ronen Abravanel wrote:
> > Currently, in Lyx 2.0, there are 3 modes for preview:
> > * On -- Preview is working for math and preview-inset
> > * No math --
> > * Off
> >
> > My 1st question is what the different between "no math" and Off? what
> else
> > is previewed other than math and preview inset?
>
> for example external insets use this mechanism to render pictures
>
> > My second concern is the reason this mail is on the developers list: Is
> > there any reason no to separate the rendering of the preview-inset from
> > regular math? for 98 percent of my math -- I prefer it will not be
> rendered.
> > But for the other two percent -- the diagrams (either using \xymatrix,
> the
> > new \Diagram inset, or just plain-old ERT), I would really like to be
> > previewed.
> >
> > If it's some arbitrary decision, and you didn't thought it's important,
> I'll
> > be happy to try and do the change..
>
> original author is currently away... personally i have no problem with
> separating it.
> i guess that you would be happy to connect "no math" with your usecase?
>
> >(although i'll be happy for some
> > pointers, as I don't yet very familiar with lyx' code).
>
> for the insetpreview part, quick peek gives two possibly interesting
> commits 38890, 33890:
>
> git log --author=vfr |grep -A2 InsetPreview
> New file format for InsetPreview introduced in r38890.
>
> git-svn-id:
> svn://svn.lyx.org/lyx/lyx-devel/tr...@33891a592a061-630c-0410-9148-cb99ea01b6c8
> --
> Introduce InsetPreview.
>
> git-svn-id:
> svn://svn.lyx.org/lyx/lyx-devel/tr...@33890a592a061-630c-0410-9148-cb99ea01b6c8
>
> pavel
>
--- lyx-2.0.0alpha6_feyn/src/insets/InsetPreview.cpp 2010-09-15 16:33:43.000000000 -0400
+++ lyx-2.0.0alpha6/src/insets/InsetPreview.cpp 2010-09-19 11:56:12.000000000 -0400
@@ -78,7 +78,7 @@ void InsetPreview::preparePreview(DocIte
bool InsetPreview::previewState(BufferView * bv) const
{
- if (!editing(bv) && RenderPreview::status() == LyXRC::PREVIEW_ON) {
+ if (!editing(bv) && (RenderPreview::status() == LyXRC::PREVIEW_ON || RenderPreview::status() == LyXRC::PREVIEW_NO_MATH)) {
graphics::PreviewImage const * pimage =
preview_->getPreviewImage(bv->buffer());
return pimage && pimage->image();