]> git.lyx.org Git - features.git/commitdiff
Implement buffer-write force
authorJuergen Spitzmueller <spitz@lyx.org>
Tue, 31 Mar 2020 06:01:17 +0000 (08:01 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 13:48:55 +0000 (15:48 +0200)
lib/bind/cua.bind
lib/bind/emacs.bind
lib/bind/mac.bind
lib/bind/xemacs.bind
src/LyXAction.cpp
src/frontends/qt/GuiView.cpp

index 31a493b09ac75b3d3587b6639b31ae31d5bb3300..918ca02d7a6b75e3dae63ed0ea83cbe0f49261c4 100644 (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"
index 60f849b67d4b720f3c7c44f7c7bb9a349b399898..e7c587d004b2e1b8c75c7460715a387ef8b3b1ed 100644 (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"                     "------"
index bceea69026d73c0bc4e60b60db89a41ee172946c..0d7459fbe24fb0feb7dd05fbd79aa639ea984dc4 100644 (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"
index 776f5d5e84309542f3097cd973217f51e7e302b1..13decd386022eb0a899900386ff519b6b30ffd0f 100644 (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"                     "------"
index a9789ad29037467c94d4ea959fe06c618a77134b..6089e5e8d9167638c5b9b907dc6f3f8ca1482c1e 100644 (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 },
index c7a1bd94581ae211e3187b3d240f1cc722291b8e..78e0817cdd37ef67f060c1f140d4a7f176e346d3 100644 (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.