TexRow now returns a range {start, end} when looking up a particular row.
Reverse-search now selects the whole range instead of simply moving the cursor.
Revert to the strategy used at 8f86ee74 but not using mathedWordList
because it may be still uninitialized at load time. Instead, use the
globalMacros method for getting the same info.
There was a thinko at 8ec91e80, because globalMacros always returns
null for user defined macros.
The math macros system is quite complex. Macros are updated during
metrics calculation, so a missing update is very likely to cause a
crash. This commit tries to assure that they are updated at export
time, which also happens when the table of contents is updated.
Moreover, in order to circumvent a possible missing update, when
a math macro is detected we try to avoid using the sym_ member
of the MacroData class, as it may contain bogus values.
Prevent setRange() from causing a recursive call to scrollTo(). Reduces three
calls of scrollTo() to one call for all scrolling functions of the scroll bar
(e.g. clicking on the arrow, dragging, or clicking somewhere on the scrollbar).
We need to invalidate the BibTeX cache when undoing or redoing. I do
not like having to do it for every undo or redo. We should only have
to do it if we restored or deleted an InsetBibTeX. But there is no
way, so far as I can see, to do it that way. I tried.
Now that Row has a pit() member, it is possible to use it instead of passing an extra pit_type parameter to a function which already has access to a Row.
The old name would be confusing wrt setSelection(), which does additional checks.
This one is a pure acessor, and the more complete methods are
* setSelection(), which avoids empty selections
* clearSelection(), which resets anchor, and sets word selection and mark more to false.
Most of the code should use these two instead of selection(bool), but this is for later.
When document settings are modified, a command
inset-forall Branch inset-toggle asign
is run to open as needed all branches. At the end of the said loop,
the cursor is reset to where it was. However, the cur_after undo
element member is not set because it already had a value.
To make this work as expected, it is necessary in LFUN_INSET_FORALL to
reset the cursor before ending the undo group and to insert a dummy
recordUndo call.
Fixes bug #10097.
Deriving from std::vector to provide helper functions appears a touch
excessive. Use typedef instead and move helper functions to the base class. New
header Toc.h provided to replace forward-declarations.
Remove TocIterator which is useless.
inset-select-all has 3 levels
1. select current cell
2. select all cells
3. select inset from outside.
The second level makes sense for tables (text and math), but not for things like a math fraction.
Introduce a new method Inset::isTable() that allows to detect this case properly and skip level 2.
The context menu of newline insets was completely greyed out if one clicked
at the right of the inset. Thanks Scott for finding this. The fix is to undo
the cursor movement also for insets without settings, but with a context menu.
and record an undo call. This deals with the problem of marking
the Buffer dirty, as well.
Move LFUN_BUFFER_TOGGLE_COMPRESSION and LFUN_BUFFER_TOGGLE_OUTPUT_SYNC
to Buffer.cpp, and add an undo call.
There was a problem with end of paragraph markers. By design, wide insets choose their size without taking in account the marker. This should not lead to unneeded horizontal scrolling.
Part of ticket #9807.
Rewrite the logic completely:
* fix cases where the offset was reset unnecessarily
* fix cases where the row was scrolled too much: as soon as a side of the row is completely visible, there is no need to scroll more.
* fix cases where offset would never reset
This partially reverts commit 0f1fdaaa9, but only redraws the current
row when the value returns by getPos is obviously false. It would also
be possible to check whether the current cursor has all its insets in
cache instead.
A better fix should be found, but this is unfortunately not 2.2 stuff.
Fixes bugs #9796 and #9812.
We already have a CoordCache of insets dimensions. It is not necessary
to store the same information in two places.
Give a name to CoordCache tables types to improve code readability.
Remove ParagraphMetrics::singleWidth, which is not used anymore.
These features are active in DEVEL_VERSION when Debug is set to LATEX.
1. The TexRow information is prepended to the source panel.
2. Clicking on any line in the source triggers reverse search. (This would be an
interesting feature to implement on the user side, but we need a proper LFUN.)
The context menu did no longer work for some insets, since it requires the
cursor to be in front, and editXY() is also used to determine the inset for
the context menu. Now the cursor is corrected if needed.
These were found by cppcheck:
Member variable 'x' is not initialized in the constructor.
The crash #9788 would not have happened if this had been done earlier.
We introduce TocBuilder for building TOCs that take into account both float
insets and their captions.
* Floats without caption are shown with their content.
* Floats with a caption are shown with their caption, but clicking the entry now
correctly moves to the float and not to the caption.
* Subsequent captions produce additional entries in the TOC.
* Figures and subfigures are correctly ordered in the outliner.
* New TOC "senseless" for captions appearing alone (a bit like broken references
are still displayed in the menu and outliner).
* Disable LFUN_CAPTION_INSERT if there is already a caption in a listing
Known issues:
* Inconsistent output for includes located inside floats
* We should record the end of the float in addition of the beginning for a more
accurate cursor -> outliner entry conversion
This solves a few bugs related to the font not being set correctly.
For example, when putting a selection somewhere with
putSelectionAt(), the font was not reset so that before this commit
if the cursor was in an ERT, strange things could happen.
putSelectionAt() is notably used when highlighting the location
corresponding with a LaTeX error (GuiErrorList), when using find,
and when using the spellcheck. I could reproduce the bug using all
three of these.
Bug #9500 is an example of the type of bugs that this commit fixes.
The bug workaround added an extra repaint, which can be very bad when
editing large tables.
It turns out that the bug this is trying to fix is due to the handling
of LFUN_LINE_END in InsetMathGrid. Adding the same code as in
InsetMathNest fixes the problem.
The workaround can therefore be removed.
Currently, insets are notified that the cursor entered or leaved them in Cursor::dispatch. This is not the cas efor lfuns which are handled in BufferView.
Adding the proper code allows to fix many bugs where previews are not updated correctly.
This also reverts cf4f79f8, which was the same fix for a particular case.
Fixes bug #6173.