The reason we want to do this is for if there is pasting across buffers.
For within buffer, the previews should already be updated. Calling the
buffer-wide updatePreviews() might seem like overkill, but actually it
should be quick because only the previews that need updating are updated
(and this check feels quick to me, although I did not profile).
If we were to loop through the pasted text and update each preview
individually, this might take more time. When updating previews
together, only one .tex file is compiled.
Normally the theBufferList().updatePreviews(); statement would go inside
of PrefDisplay::applyRC. However, that would not work well because
Buffer::updatePreviews() calls loader() which conditions on
(lyxrc.preview == LyXRC::PREVIEW_OFF) but the new RC has not been set at
this point.
When editing a preview inset, or math, when we leave the inset, we
should update the preview. This update now happens for screen-up and
screen-down (commonly bound to Page Up and Page Down).
Note that this is only relevant if preview is turned on in
preferences.
This commit probably fixes other issues for any inset that defines
notifyCursorLeaves().
This fixes only part of #6173.
The bug that caused these tests to enter into infinite loops
(and have a memory leak) has been fixed. These tests now
pass on an updated TeX Live 2014 as well as the current TeX
Live 2015 pretest.
The \lightning symbol is text mode only. Hence, for using it in
mathed, it must be inserted in a text mode environment such as
\mbox, \text, etc. However, as it is not marked as textmode,
LyX "helpfully" encloses it in \ensuremath everytime one tries
to put it in a text mode environment, thus defying the countermeasure.
By declaring it textmode only, LyX stops doing that and thus it can be
correctly output by simply selecting it and hitting Ctrl-M.
Sometimes, even compilable documents could not display preview
snippets. Previously the preview was computed only with help
of latex or xelatex.
This also fixes#9371
The FontMetrics dummy class was in the wrong namespace. Linking on linux
did work because the GNU linker is more clever than the MSVC linker for this
particular example and throws out more unused code, so that theFontMetrics was
not referenced at all.