mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 05:25:26 +00:00
Fix gotoLabel with inactive labels
This now frist looks for the active label. Only if none is found, it jumps to the (first) inactive label.
This commit is contained in:
parent
5afacb144d
commit
54366c38ef
@ -2515,15 +2515,26 @@ bool BufferView::setCursorFromInset(Inset const * inset)
|
||||
|
||||
void BufferView::gotoLabel(docstring const & label)
|
||||
{
|
||||
FuncRequest action;
|
||||
bool have_inactive = false;
|
||||
for (Buffer const * buf : buffer().allRelatives()) {
|
||||
// find label
|
||||
for (TocItem const & item : *buf->tocBackend().toc("label")) {
|
||||
if (label == item.str()) {
|
||||
if (label == item.str() && item.isOutput()) {
|
||||
lyx::dispatch(item.action());
|
||||
return;
|
||||
}
|
||||
// If we find an inactive label, save it for the case
|
||||
// that no active one is there
|
||||
if (label == item.str() && !have_inactive) {
|
||||
have_inactive = true;
|
||||
action = item.action();
|
||||
}
|
||||
}
|
||||
}
|
||||
// We only found an inactive label. Go there.
|
||||
if (have_inactive)
|
||||
lyx::dispatch(action);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user