mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
* LFUN_BUFFER_RELOAD - allow dropping of the changes.
Useful in scripts.
This commit is contained in:
parent
e57b245d0b
commit
46826155a8
@ -742,7 +742,8 @@ void LyXAction::init()
|
||||
/*!
|
||||
* \var lyx::FuncCode lyx::LFUN_BUFFER_RELOAD
|
||||
* \li Action: Reverts opened document.
|
||||
* \li Syntax: buffer-reload
|
||||
* \li Syntax: buffer-reload [dump]
|
||||
* \li Params: dump: do not ask for any confirmation, just reload. All changes will be lost.
|
||||
* \li Origin: Asger, 2 Feb 1997
|
||||
* \endvar
|
||||
*/
|
||||
|
@ -3845,8 +3845,11 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
|
||||
case LFUN_BUFFER_RELOAD: {
|
||||
LASSERT(doc_buffer, break);
|
||||
|
||||
//drop changes?
|
||||
bool drop = (cmd.argument()=="dump");
|
||||
|
||||
int ret = 0;
|
||||
if (!doc_buffer->isClean()) {
|
||||
if (!drop && !doc_buffer->isClean()) {
|
||||
docstring const file =
|
||||
makeDisplayPath(doc_buffer->absFileName(), 20);
|
||||
if (doc_buffer->notifiesExternalModification()) {
|
||||
|
Loading…
Reference in New Issue
Block a user