The trick is to remember in BufferView what has been done at the
previous draw, so that the row that contained the caret can be
repainted if needed.
To this end, add an argument paint_caret to BufferView, although
painting the caret is not the job of the BufferView (at this point).
BufferView::needRepaint will act as an interface with
TextMetrics::drawParagraph to know whether the painting of a given
row should be forced.
Currently everything is done at the top row level, so that, if the
caret is in a large table, the whole table will have to be repainted.
It is not clear yet that this is necessary.
Normally the two stages of drawing are
1/ compute metrics of insets/rows/paragraphs/mathrow...
2/ draw the elements and cache their positions
Now the three stages are
1/ metrics
2/ nodraw: do not draw the elements, but cache their position
3/ draw the elements (and store again their position; it does not
seems to hurt performance).
Revive the NullPainter: this replaces the setDrawingEnabled mechanism
with a painter that does nothing. The advantage is that updatePosCache
(renamed from setPosCache) does not need anymore to be invoked from
the frontend.
updatePosCache (the nodraw stage) is called at the end of
BufferView::updateMetrics.
This fixes 3 bugs:
1/ only spaces are considered as part of the prefix
2/ leading tabs are removed unconditionally
3/ off-by-one error in the removal
The new intended behavior is:
1/ find the prefix (sequence of spaces and tabs) before the first
line; remove this prefix from the line
2/ on the next lines, check whether they start with the same prefix,
and if they do, strip this prefix
The inkscape command was hardcoded, but it seems that we need the full
patch on Windows. Therefore we check in configure.py if inkscape is
installed and pass the proper name (and possibly path) to the scripts.
Richard Heck [Mon, 21 Aug 2017 21:25:15 +0000 (17:25 -0400)]
Change backticks to preferred $(...) syntax.
Replace A && B || C syntax with if-then-else. Apparently, this can
fail, even if B is "echo ...", if STDOUT is for some reason closed.
See https://github.com/koalaman/shellcheck/wiki/SC2015.
Scott Kostyshak [Mon, 7 Aug 2017 05:54:55 +0000 (01:54 -0400)]
Remove a sometimes blocked call to dispatch
Dispatching LFUN_BUFFER_ZOOM inside of GuiView::restoreLayout() was
blocked in some cases because the function can be called without a
buffer (and the LFUN is marked as needing a buffer). Instead of
conditioning on a buffer, the call is removed because in testing it
does not appear why it is needed.
This commit removes the status message that is displayed if starting
LyX without opening a buffer:
Use the OK/Apply paradigm for all document settings
Due to its peculiarity of not being saved in the document, the
shell escape setting was applied immediately without the need
for hitting the Apply or OK buttons. However, for uniformity
sake, it is better to adhere to the established paragdim of
confirming any changes before applying them.
Scott Kostyshak [Sat, 5 Aug 2017 02:12:15 +0000 (22:12 -0400)]
Fix es.po issue causing broken LyXHTML export
Because of a missing backslash, a layout label was not correct.
This caused display issues for the layout in the LyX GUI, but since
the label is not used in export to LaTeX, the ctests for LaTeX
export all passed. Luckily, our LyXHTML test (in particular, the
xmllint part) caught the failure because the lables are exported.
The GUI label now looks good and the following test passes:
Kornel Benko [Fri, 4 Aug 2017 09:56:19 +0000 (11:56 +0200)]
keytests: Allow for checking multiple log files
Handle name may be arbitrary string mathing '[A-Za-z0-9]*'.
This is then used by appending to the commands for the control file.
For instance select 'Alpha' as handle for the control file 'abc'
'COAlpha: abc' ==> open 'abc' for write
'CCAlpha:' ==> close 'abc'
jpc [Fri, 4 Aug 2017 07:19:48 +0000 (09:19 +0200)]
Publishable version of fr/Additional.lyx
New file collecting what to be translated in localized version of Additional
A couple of typos in Additional.lyx
Allow a LaTeX backend to run external commands after user confirmation.
This is a per document and per machine setting. The authorization has
to be given through the document settings pane, but is not recorded in
the document itself. Moving the document to either another computer or
another directory on the same computer revokes the authorization.
This can also be done by right clicking the red icon that appears in
the status bar when a document is marked as one requiring shell escape.
The patch also checks whether the user has added the -shell-escape
option to a LaTeX converter and nags the user to remove the option
(which would be used for all documents) in favor of the (per document)
support offered by LyX.