It turns out that the commit from gadmm's lyx-unstable has been
cherry-picked at the wrong place! However I believe that both changes
are necessary.
With this second patch, I do see that some screen jumping is avoided.
Fixes bug #7457.
The context menu for InsetMathRef is now usable.
InsetMathRef still misses support for RefStyle and thus the
corresponding entries are omitted from the menu. But this would
be a different bug.
It is now possible to get a context menu for math insets.
InsetMathSpace was already providing a specific context menu,
but it was never triggered because the math hull inset is not
descendable. It is still so, but now when a context menu is
requested all the insets inside the math hull are examined.
If the inset under the cursor provides a context menu, it
is shown instead of the general math one.
Fixes#12100.
The bookmarks are shown with circled numbers in the right margin (or
the left margin in RTL mode). A new color "bookmarks" has been added.
Currently bookmark 0 (the return position) is not displayed because it
is very disturbing in practice.
To make this work, a new method BookmarksSection::bookmarksInPar
retuns the list of bookmarks in a paragraph along with their position.
Force redraw when using bookmark-save and bookmark-clear.
Caveats:
- this solution does not show the precise position of the bookmark
(this is supposedly not a problem).
- if several bookmarks are on the same row, they will currently be
garbled. It would be easy to make sure that only one is shown ; what
would be more difficult would be to move the second bookmark lower.
- it is possible to make sure that the markers are correctly centered
in the margin, and that the margin size is large enough to hold the
marker (I did not try all fonts).
Fixes bug #2496.
Keep from 907f0207 the introduction of BufferView::top/bottomMargin()
and the setting of the top/bottom margin of the document. The
difference is that the extra height is still added to the relevant
rows, and not only to the paragraph metrics.
Keep from f41ca959 the reduction of top/bottom margin for Adv F&R
workareas.
Just recompute metrics instead of triggering a full redraw. The old
behavior was that, when the document was less that one page long, the
cursor would blink to the top of the document before going to its
correct position.
When the cursor is at the top, it is important to make sure that, not
only its row is visible, but also the extra margin at the beginning of
the document, that was added at 907f0207.
Fixes part of bug #12123.
This stores its argument, the currently selected text or the word under
cursor in the search cache that is used by word-find[-backward|-forward]
if no argument is given to those.
Prerequisite for a feature apparently expected on the Mac.
Following 4a4ded22, the enabling of some change-related functions is
handled in updateBuffer. However, this method is not ran at every
document change for performance reasons.
This patch adds code to every place that modifies
Paragraph::Private::changes_ that checks whether the `changedness' of
the paragraph, err... changes.
To this end, a new helper struct is introduced that remembers
paragraph state at contruction time, and compares it to new state in
the destructor.
New forceUpdate/needUpdate methods are added to Buffer class, since
the cursor is in general not available in the places where these
changes are made.
Fixes bug #12074.
It turns out that the code is the same in texted ans mathed and that
whatever is done in InsetTabular is not useful.
This means that we do not need to deal Text::dispatch idiosyncrasies
(in particular forcing the cursor to be visible).
Fix bug #11225.
The bookmarks are added as virtual elements in display Rows. Bookmarks
are shown with circled numbers. A new color "bookmarks" has been
added. Currently bookmark 0 (the return position) is not displayed
because it is very disturbing in practice.
To make this work, a new method BookmarksSection::bookmarksInPar
retuns the list of bookmarks in a paragraph along with their position.
Force redraw when using bookmark-save and bookmark-clear.
Fixes bug #2496.
The caret geometry is now computed in BufferView as a list of shapes
(caret, horizontal l-shape if needed, completion triangle if needed)
kept in a variable of type CaretGeometry.
The code in WorkArea.cpp only has to draw these shapes. The
CaretWidget (which never was a widget) in GuiWorkArea.cpp is gone
now.
As a consequence, the bounding box for the cursor is known precisely
and therefore rows should be repainted correctly now. This avoids
caret droppings.
Fixes bug #12024.
Try to find the most inner row that is overwritten by the caret. This
allows to replace the hack in TextMetrics::draw, which did not really
work.
Note that there are still issues with emphasized caret at the
beginning of inset, which will require some code reorganisation.
Fixes current recipe of bug #12024.
Intended changes:
* code is shorter and cleaner
* caret scales better with zoom when cursor_width=0: completion
indicator, l-shaped cursor...
Details:
* Rename BufferView::getPosAndHeight to getPosAndDim because ascent is
needed too and width could in the future be set depending on font.
* Get rid of rect_ in CaretWidget and record a Dimension (and y value) instead.
Remove also caret_width_ and slant_, replace rtl_ with dir.
* Make CaretWidget members public and lose the trailing _.
* change CaretWidget::update to read its parameters from current bufferview.
It did access par_metrics_[] directly because there was no non-const
parMetrics().
This patch adds one and unfriends BufferView. The code is equivalent
since in all these cases, the metrics have just been computed with
redoParagraph().