odeke-em / vim

Automatically exported from code.google.com/p/vim
0 stars 0 forks source link

solution problem with the command noswapfile on vimgolf #237

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
A lot of challenges on vimgolf doesn't work, because of adding the vim command 
noswapfile.

It is possible to change the command noswapfile to no_swapfile?

I modified two files ex_cmds.h and ex_docmd.c to change the command to 
no_swapfile and added the diff files :

C:\ruby-2.0.0-p481\bin>diff -u C:\vim_nsf\src\ex_cmds.h C:\vim\src\ex_cmds.h
--- C:\vim_nsf\src\ex_cmds.h       2014-07-10 19:50:43.309923700 +0300
+++ C:\vim\src\ex_cmds.h   2014-06-26 08:55:08.186579100 +0300
@@ -655,7 +655,7 @@
                        EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
 EX(CMD_noremenu,       "noremenu",     ex_menu,
                        RANGE|NOTADR|ZEROR|BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
-EX(CMD_noswapfile,     "no_swapfile",  ex_wrongmodifier,
+EX(CMD_noswapfile,     "noswapfile",   ex_wrongmodifier,
                        NEEDARG|EXTRA|NOTRLCOM),
 EX(CMD_normal,         "normal",       ex_normal,
                        RANGE|BANG|EXTRA|NEEDARG|NOTRLCOM|USECTRLV|SBOXOK|CMDWIN),

C:\ruby-2.0.0-p481\bin>diff -u C:\vim_nsf\src\ex_docmd.c C:\vim\src\ex_docmd.c
--- C:\vim_nsf\src\ex_docmd.c      2014-07-10 19:52:24.349702900 +0300
+++ C:\vim\src\ex_docmd.c  2014-06-26 08:55:08.219581000 +0300
@@ -1887,7 +1887,7 @@
 #endif
                            continue;
                        }
-                       if (!checkforcmd(&ea.cmd, "no_swapfile", 6))
+                       if (!checkforcmd(&ea.cmd, "noswapfile", 6))
                            break;
                        cmdmod.noswapfile = TRUE;
                        continue;
@@ -3105,7 +3105,7 @@
     {"leftabove", 5, FALSE},
     {"lockmarks", 3, FALSE},
     {"noautocmd", 3, FALSE},
-    {"no_swapfile", 3, FALSE},
+    {"noswapfile", 3, FALSE},
     {"rightbelow", 6, FALSE},
     {"sandbox", 3, FALSE},
     {"silent", 3, FALSE},

What version of the product are you using? On what operating system?
vim 7.4.355

Please provide any additional information below.

A lot of challenge on vimgolf use normal command using only 5 keystrokes
 :%no<S-Tab>
for example the challenge http://vimgolf.com/challenges/4d1c27940e3d7832db000010

After Vim 7.4.213, there is a new command noswapfile, and it is necessary for 6 
keystrokes to have the normal command
 :%nor<S-Tab>, and a lot of vimgolf solutions no longer valid. 

Thanks in advance ! 

Original issue reported on code.google.com by Zulolox4...@gmail.com on 10 Jul 2014 at 5:53

GoogleCodeExporter commented 9 years ago
Hello !
Created and tested the attached patch file for vim 7.4.389. Changed the command 
:noswapfile to :no_swapfile.

Original comment by Zulolox4...@gmail.com on 31 Jul 2014 at 7:00

Attachments:

GoogleCodeExporter commented 9 years ago
Why should Vim change the command name just because it caused a specific 
completion to invalidate solutions to a gamification of Vim?  There's no 
functional bug here, just a change in the minimum number of keys needed to 
solve those challenges.  Take it as providing another opportunity to find a 
minimal solution to those challenges.

Original comment by vega.james@gmail.com on 1 Aug 2014 at 12:14

GoogleCodeExporter commented 9 years ago
You can't rely on Vim never adding new commands.  Command line completion will 
pick up new commands once in a while, that can't be avoidec.

Original comment by brammool...@gmail.com on 1 Aug 2014 at 12:01