Implement buffer-write force

This commit is contained in:
Juergen Spitzmueller 2020-03-31 08:01:17 +02:00
parent 38ba0ea240
commit fe09ddf1b9
6 changed files with 10 additions and 7 deletions

View File

@ -105,7 +105,7 @@ Format 5
#bind "F1" "help" # Not yet implemented!
#bind "C-F1" "help-context" # Not yet implemented!
\bind "F2" "buffer-write"
\bind "F2" "buffer-write force"
\bind "F3" "word-find"
\bind "C-F4" "buffer-close"
\bind "M-F4" "lyx-quit"

View File

@ -136,8 +136,8 @@ Format 4
#bind "F1" "help" # Not yet implemented!
#bind "C-F1" "help-context" # Not yet implemented!
#\bind "F2" "buffer-write"
#\bind "F3" "file-open"
\bind "F2" "buffer-write force"
#\bind "F3" "file-open"
#bind "F4" "------"
#bind "F5" "------"
#bind "F6" "------"

View File

@ -271,7 +271,7 @@ Format 4
#bind "F1" "help" # Not yet implemented!
#bind "C-F1" "help-context" # Not yet implemented!
\bind "F2" "buffer-write"
\bind "F2" "buffer-write force"
\bind "C-F4" "buffer-close"
\bind "C-A-Up" "scroll line up"
\bind "C-A-Down" "scroll line down"

View File

@ -130,7 +130,7 @@ Format 4
#bind "F1" "help" # Not yet implemented!
#bind "C-F1" "help-context" # Not yet implemented!
#\bind "F2" "buffer-write"
\bind "F2" "buffer-write force"
#\bind "F3" "file-open"
#bind "F4" "------"
#bind "F5" "------"

View File

@ -892,7 +892,8 @@ void LyXAction::init()
* \li Notion: Saves the current buffer to disk, using the filename that
is already associated with the buffer, asking for one if
none is yet assigned.
* \li Syntax: buffer-write
* \li Syntax: buffer-write [force]
* \li Params: force: write even if buffer is clean.
* \endvar
*/
{ LFUN_BUFFER_WRITE, "buffer-write", ReadOnly, Buffer },

View File

@ -1996,7 +1996,9 @@ bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
}
case LFUN_BUFFER_WRITE:
enable = doc_buffer && (doc_buffer->isUnnamed() || !doc_buffer->isClean());
enable = doc_buffer && (doc_buffer->isUnnamed()
|| (!doc_buffer->isClean()
|| cmd.argument() == "force"));
break;
//FIXME: This LFUN should be moved to GuiApplication.