[Cmake-commits] CMake branch, next, updated. v3.6.1-1059-g57addbd

Brad King brad.king at kitware.com
Tue Aug 2 14:55:45 EDT 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  57addbd3e72f7f16595ba2245a12da9eeac12535 (commit)
       via  e34e9c2705c9e0bb568f5f69a655a9d425ef8adb (commit)
       via  9a1b6c6037869edba1c44dcfa06da8201653ce1b (commit)
       via  31b6cf41c5a4e17ea97e0c94f0e81b9a18ce96b8 (commit)
      from  bfefab9fe5a3d517d4aadd02ecde2b064c438fb4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=57addbd3e72f7f16595ba2245a12da9eeac12535
commit 57addbd3e72f7f16595ba2245a12da9eeac12535
Merge: bfefab9 e34e9c2
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Aug 2 14:55:44 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Aug 2 14:55:44 2016 -0400

    Merge topic 'ccmake-vim-navigation' into next
    
    e34e9c27 ccmake: Add VIM-like bindings for navigation
    9a1b6c60 ccmake: Revise documentation for [d]
    31b6cf41 ccmake: Fix typo in help (it's -> its)


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e34e9c2705c9e0bb568f5f69a655a9d425ef8adb
commit e34e9c2705c9e0bb568f5f69a655a9d425ef8adb
Author:     Paul Seyfert <paul.seyfert at mib.infn.it>
AuthorDate: Thu Jul 21 21:30:50 2016 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Aug 2 14:53:15 2016 -0400

    ccmake: Add VIM-like bindings for navigation
    
    * scroll with j/k
    * toggle bool with space, enter insert mode with i
    * bindings not shown at the bottom of the screen, but given in help

diff --git a/Help/release/dev/ccmake-vim-navigation.rst b/Help/release/dev/ccmake-vim-navigation.rst
new file mode 100644
index 0000000..8fc1416
--- /dev/null
+++ b/Help/release/dev/ccmake-vim-navigation.rst
@@ -0,0 +1,4 @@
+ccmake-vim-navigation
+---------------------
+
+* :manual:`ccmake(1)` learned to support vim-like navigation bindings.
diff --git a/Source/CursesDialog/cmCursesBoolWidget.cxx b/Source/CursesDialog/cmCursesBoolWidget.cxx
index 9bcf050..e36ac34 100644
--- a/Source/CursesDialog/cmCursesBoolWidget.cxx
+++ b/Source/CursesDialog/cmCursesBoolWidget.cxx
@@ -27,8 +27,9 @@ cmCursesBoolWidget::cmCursesBoolWidget(int width, int height, int left,
 bool cmCursesBoolWidget::HandleInput(int& key, cmCursesMainForm*, WINDOW* w)
 {
 
+  // toggle boolean values with enter or space
   // 10 == enter
-  if (key == 10 || key == KEY_ENTER) {
+  if (key == 10 || key == KEY_ENTER || key == ' ') {
     if (this->GetValueAsBool()) {
       this->SetValueAsBool(false);
     } else {
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx
index fd19a01..964f3af 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -837,7 +837,9 @@ void cmCursesMainForm::HandleInput()
       // therefore, the label field for the prev. entry is index-5
       // and the label field for the next entry is index+1
       // (index always corresponds to the value field)
-      else if (key == KEY_DOWN || key == ctrl('n')) {
+      // scroll down with arrow down, ctrl+n (emacs binding), or j (vim
+      // binding)
+      else if (key == KEY_DOWN || key == ctrl('n') || key == 'j') {
         FIELD* cur = current_field(this->Form);
         size_t findex = field_index(cur);
         if (findex == 3 * this->NumberOfVisibleEntries - 1) {
@@ -854,7 +856,8 @@ void cmCursesMainForm::HandleInput()
       // therefore, the label field for the prev. entry is index-5
       // and the label field for the next entry is index+1
       // (index always corresponds to the value field)
-      else if (key == KEY_UP || key == ctrl('p')) {
+      // scroll down with arrow up, ctrl+p (emacs binding), or k (vim binding)
+      else if (key == KEY_UP || key == ctrl('p') || key == 'k') {
         FIELD* cur = current_field(this->Form);
         int findex = field_index(cur);
         if (findex == 2) {
@@ -1122,16 +1125,17 @@ const char* cmCursesMainForm::s_ConstHelpMessage =
   "Navigation: "
   "You can use the arrow keys and page up, down to navigate the options. "
   "Alternatively, you can use the following keys: \n"
-  " C-n : next option\n"
-  " C-p : previous options\n"
+  " C-n or j : next option\n"
+  " C-p or k : previous options\n"
   " C-d : down one page\n"
   " C-u : up one page\n\n"
   "Editing options: "
   "To change an option  press enter or return. If the current options is a "
   "boolean, this will toggle its value. "
-  "Otherwise, ccmake will enter edit mode. In this mode you can edit an "
-  "option using arrow keys and backspace. Alternatively, you can use the "
-  "following keys:\n"
+  "Otherwise, ccmake will enter edit mode. Alternatively, you can toggle "
+  "a bool variable by pressing space, and enter edit mode with i."
+  "In this mode you can edit an option using arrow keys and backspace. "
+  "Alternatively, you can use the following keys:\n"
   " C-b : back one character\n"
   " C-f : forward one character\n"
   " C-a : go to the beginning of the field\n"
diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx
index 6eb5310..46b8b86 100644
--- a/Source/CursesDialog/cmCursesStringWidget.cxx
+++ b/Source/CursesDialog/cmCursesStringWidget.cxx
@@ -67,8 +67,10 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm,
   int x, y;
 
   FORM* form = fm->GetForm();
+  // when not in edit mode, edit mode is entered by pressing enter or i (vim
+  // binding)
   // 10 == enter
-  if (!this->InEdit && (key != 10 && key != KEY_ENTER)) {
+  if (!this->InEdit && (key != 10 && key != KEY_ENTER && key != 'i')) {
     return false;
   }
 
@@ -97,11 +99,15 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm,
     }
 
     // If resize occurred during edit, move out of edit mode
-    if (!this->InEdit && (key != 10 && key != KEY_ENTER)) {
+    if (!this->InEdit && (key != 10 && key != KEY_ENTER && key != 'i')) {
       return false;
     }
-    // 10 == enter
-    if (key == 10 || key == KEY_ENTER) {
+    // enter edit with return and i (vim binding)
+    if (!this->InEdit && (key == 10 || key == KEY_ENTER || key == 'i')) {
+      this->OnReturn(fm, w);
+    }
+    // leave edit with return (but not i -- not a toggle)
+    else if (this->InEdit && (key == 10 || key == KEY_ENTER)) {
       this->OnReturn(fm, w);
     } else if (key == KEY_DOWN || key == ctrl('n') || key == KEY_UP ||
                key == ctrl('p') || key == KEY_NPAGE || key == ctrl('d') ||

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9a1b6c6037869edba1c44dcfa06da8201653ce1b
commit 9a1b6c6037869edba1c44dcfa06da8201653ce1b
Author:     Paul Seyfert <paul.seyfert at mib.infn.it>
AuthorDate: Thu Jul 21 21:29:18 2016 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Aug 2 14:53:15 2016 -0400

    ccmake: Revise documentation for [d]
    
    * list it at the bottom of the screen
    * different place in help message

diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx
index b9fd8f8..fd19a01 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -388,7 +388,7 @@ void cmCursesMainForm::PrintKeys(int process /* = 0 */)
 
   curses_move(y - 4, 0);
   char fmt_s[] = "%s";
-  char fmt[512] = "Press [enter] to edit option";
+  char fmt[512] = "Press [enter] to edit option Press [d] to delete an entry";
   if (process) {
     strcpy(fmt, "                           ");
   }
@@ -1140,7 +1140,6 @@ const char* cmCursesMainForm::s_ConstHelpMessage =
   " C-k : kill the rest of the field\n"
   " Esc : Restore field (discard last changes)\n"
   " Enter : Leave edit mode\n"
-  "You can also delete an option by pressing 'd'\n\n"
   "Commands:\n"
   " q : quit ccmake without generating build files\n"
   " h : help, shows this screen\n"
@@ -1148,6 +1147,7 @@ const char* cmCursesMainForm::s_ConstHelpMessage =
   " g : generate build files and exit, only available when there are no "
   "new options and no errors have been detected during last configuration.\n"
   " l : shows last errors\n"
+  " d : delete an option\n"
   " t : toggles advanced mode. In normal mode, only the most important "
   "options are shown. In advanced mode, all options are shown. We recommend "
   "using normal mode unless you are an expert.\n"

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=31b6cf41c5a4e17ea97e0c94f0e81b9a18ce96b8
commit 31b6cf41c5a4e17ea97e0c94f0e81b9a18ce96b8
Author:     Paul Seyfert <paul.seyfert at mib.infn.it>
AuthorDate: Tue Aug 2 10:41:06 2016 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Aug 2 14:53:06 2016 -0400

    ccmake: Fix typo in help (it's -> its)

diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx
index 9ae38d6..b9fd8f8 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -1128,7 +1128,7 @@ const char* cmCursesMainForm::s_ConstHelpMessage =
   " C-u : up one page\n\n"
   "Editing options: "
   "To change an option  press enter or return. If the current options is a "
-  "boolean, this will toggle it's value. "
+  "boolean, this will toggle its value. "
   "Otherwise, ccmake will enter edit mode. In this mode you can edit an "
   "option using arrow keys and backspace. Alternatively, you can use the "
   "following keys:\n"

-----------------------------------------------------------------------

Summary of changes:
 Help/release/dev/ccmake-vim-navigation.rst   |    4 ++++
 Source/CursesDialog/cmCursesBoolWidget.cxx   |    3 ++-
 Source/CursesDialog/cmCursesMainForm.cxx     |   24 ++++++++++++++----------
 Source/CursesDialog/cmCursesStringWidget.cxx |   14 ++++++++++----
 4 files changed, 30 insertions(+), 15 deletions(-)
 create mode 100644 Help/release/dev/ccmake-vim-navigation.rst


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list