mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-21 23:09:40 +00:00
Make LFUN_BUFFER_NEXT and _PREVIOUS skip documents that are open
but not shown. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28900 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
08467b3ddc
commit
b0177410b0
@ -1928,6 +1928,28 @@ bool GuiView::closeBuffer(Buffer & buf, bool tolastopened)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void GuiView::gotoNextOrPreviousBuffer(NextOrPrevious np)
|
||||||
|
{
|
||||||
|
Buffer * const curbuf = buffer();
|
||||||
|
Buffer * nextbuf = curbuf;
|
||||||
|
while (true) {
|
||||||
|
if (np == NEXTBUFFER)
|
||||||
|
nextbuf = theBufferList().next(nextbuf);
|
||||||
|
else
|
||||||
|
nextbuf = theBufferList().previous(nextbuf);
|
||||||
|
if (nextbuf == curbuf)
|
||||||
|
break;
|
||||||
|
if (nextbuf == 0) {
|
||||||
|
nextbuf = curbuf;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (workArea(*nextbuf))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
setBuffer(nextbuf);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool GuiView::dispatch(FuncRequest const & cmd)
|
bool GuiView::dispatch(FuncRequest const & cmd)
|
||||||
{
|
{
|
||||||
BufferView * bv = view();
|
BufferView * bv = view();
|
||||||
@ -1946,11 +1968,11 @@ bool GuiView::dispatch(FuncRequest const & cmd)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case LFUN_BUFFER_NEXT:
|
case LFUN_BUFFER_NEXT:
|
||||||
setBuffer(theBufferList().next(buffer()));
|
gotoNextOrPreviousBuffer(NEXTBUFFER);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LFUN_BUFFER_PREVIOUS:
|
case LFUN_BUFFER_PREVIOUS:
|
||||||
setBuffer(theBufferList().previous(buffer()));
|
gotoNextOrPreviousBuffer(PREVBUFFER);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LFUN_COMMAND_EXECUTE: {
|
case LFUN_COMMAND_EXECUTE: {
|
||||||
|
@ -295,6 +295,12 @@ private:
|
|||||||
bool saveBuffer(Buffer & b);
|
bool saveBuffer(Buffer & b);
|
||||||
///
|
///
|
||||||
bool closeBuffer(Buffer & buf, bool tolastopened = false);
|
bool closeBuffer(Buffer & buf, bool tolastopened = false);
|
||||||
|
enum NextOrPrevious {
|
||||||
|
NEXTBUFFER,
|
||||||
|
PREVBUFFER
|
||||||
|
};
|
||||||
|
///
|
||||||
|
void gotoNextOrPreviousBuffer(NextOrPrevious np);
|
||||||
|
|
||||||
///
|
///
|
||||||
Inset * getOpenInset(std::string const & name) const;
|
Inset * getOpenInset(std::string const & name) const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user