When there is a single document open, the tabbar gets hidden. The only and selected tab is still visible though as a break in the line delining the tabwidget. To fix this we paint the tabwidget ourselves and remove the presence of the hidden tab.
When the socket does not exist anymore, we should not try to access it. In
trying to do so, std::map will create a new shared_ptr but this pointer
doesn't point at anything. To prevent this, we explicitly check whether
the socket is available.
This reverts the previous fix in [0a33374c/lyxgit] and fixes it
differently.
We always have to call 'notifyCursorLeaves', but we only have to make sure
that we call the 'fixIfBroken()' functions first.
We rely on the 'or' operator to prevent us from calling
'notifyCursorLeaves' if one of the two cursors is broken. This doesn't
work when using the '|' operator. The compiler 'optimizes' the code in
such a way that we always call notifyCursorLeaves anyway. Using the '||'
operator fixes this.
The undo range is extended to encompass all the paragraph after the end that
are a non-zero depth. The reason is that these paragraphs may see their depth
reduced if the last paragraph sees its depth reduced.
Note that there is a memory cost, since we store paragraphs than may not be
modified in practice. This may matter for some pathological files (people
putting all their document at depth 1 for a weird reason?)
I tried to be careful, but this can introduce new bugs. Please test.
Only user of this function is code that has been commented out, comment
out this function as well.
Signed-off-by: Lars Gullik Bjønnes <larsbj@gullik.org>
The check whether fname != oldname does not work for unnamed buffers.
Therefore, we check explicitly whether the Buffer that already exists with
the same name isn't really the buffer we are trying to save.
Text::outerFont looks recursively for paragraphs before the current one
which has a lower depth. If such a paragraph cannot be found, depthHook
and outerHook return the current paragraph. As such, we end up in an
infinite loop. So, if we find a par_depth that was the same as the
previous one, we apparently can't find a suitable paragraph and we should
quit the loop.
In this case, the working dir has already a slash at the end.
Appending another one would result in a path ending with a double slash,
which has a special meaning when used in TEXINPUTS (all subdirs would
be recursively scanned). So, avoid doing that.
We want the key as id, not the label (which is optional).
We also need a kind of namespace for the citation ids.
We should also clean the id tag before using it.