diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-10-28 18:36:48 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-10-28 18:36:48 +0200 |
commit | c3fdf7f80b2febdd8a8f7a1310631567d257d66a (patch) | |
tree | 52419da4ad3491444daa8336699d88e9b9682ab2 /src | |
parent | c312b8b87a589ed8452dbf0f555f05ff86d04692 (diff) | |
download | vim-c3fdf7f80b2febdd8a8f7a1310631567d257d66a.zip |
patch 8.0.1232: MS-Windows users are confused about default mappings
Problem: MS-Windows users are confused about default mappings.
Solution: Don't map keys in the console where they don't work. Add a choice
in the installer to use MS-Windows key bindings or not. (Christian
Brabandt, Ken Takata, closes #2093)
Diffstat (limited to 'src')
-rw-r--r-- | src/dosinst.c | 44 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 38 insertions, 8 deletions
diff --git a/src/dosinst.c b/src/dosinst.c index bb95bd86a..5a4caac42 100644 --- a/src/dosinst.c +++ b/src/dosinst.c @@ -80,21 +80,23 @@ char *(remap_choices[]) = "Do not remap keys for Windows behavior", "Remap a few keys for Windows behavior (CTRL-V, CTRL-C, CTRL-F, etc)", }; -int remap_choice = (int)remap_win; +int remap_choice = (int)remap_no; char *remap_text = "- %s"; enum { mouse_xterm = 1, - mouse_mswin + mouse_mswin,, + mouse_default }; char *(mouse_choices[]) = { "\nChoose the way how Vim uses the mouse:", "right button extends selection (the Unix way)", - "right button has a popup menu (the Windows way)", + "right button has a popup menu, left button starts select mode (the Windows way)", + "right button has a popup menu, left button starts visual mode", }; -int mouse_choice = (int)mouse_mswin; +int mouse_choice = (int)mouse_default; char *mouse_text = "- The mouse %s"; enum @@ -155,8 +157,7 @@ get_choice(char **table, int entries) { if (idx) printf("%2d ", idx); - printf(table[idx]); - printf("\n"); + puts(table[idx]); } printf("Choice: "); if (scanf("%d", &answer) != 1) @@ -1176,6 +1177,8 @@ install_vimrc(int idx) case mouse_mswin: fprintf(fd, "behave mswin\n"); break; + case mouse_default: + break; } if ((tfd = fopen("diff.exe", "r")) != NULL) { @@ -2205,6 +2208,10 @@ print_cmd_line_help(void) printf(" Create .bat files for Vim variants in the Windows directory.\n"); printf("-create-vimrc\n"); printf(" Create a default _vimrc file if one does not already exist.\n"); + printf("-vimrc-remap [no|win]\n"); + printf(" Remap keys when creating a default _vimrc file.\n"); + printf("-vimrc-behave [unix|mswin|default]\n"); + printf(" Set mouse behavior when creating a default _vimrc file.\n"); printf("-install-popup\n"); printf(" Install the Edit-with-Vim context menu entry\n"); printf("-install-openwith\n"); @@ -2260,6 +2267,28 @@ command_line_setup_choices(int argc, char **argv) */ init_vimrc_choices(); } + else if (strcmp(argv[i], "-vimrc-remap") == 0) + { + if (i + 1 == argc) + break; + i++; + if (strcmp(argv[i], "no") == 0) + remap_choice = remap_no; + else if (strcmp(argv[i], "win") == 0) + remap_choice = remap_win; + } + else if (strcmp(argv[i], "-vimrc-behave") == 0) + { + if (i + 1 == argc) + break; + i++; + if (strcmp(argv[i], "unix") == 0) + mouse_choice = mouse_xterm; + else if (strcmp(argv[i], "mswin") == 0) + mouse_choice = mouse_mswin; + else if (strcmp(argv[i], "default") == 0) + mouse_choice = mouse_default; + } else if (strcmp(argv[i], "-install-popup") == 0) { init_popup_choice(); @@ -2424,8 +2453,7 @@ NULL printf("\n"); for (i = 0; items[i] != NULL; ++i) { - printf(items[i]); - printf("\n"); + puts(items[i]); printf("Hit Enter to continue, b (back) or q (quit help): "); c = getchar(); rewind(stdin); diff --git a/src/version.c b/src/version.c index 4ce6fee68..c600dc9cc 100644 --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1232, +/**/ 1231, /**/ 1230, |