To: vim-dev@vim.org Subject: Patch 6.1b.013 Fcc: outbox From: Bram Moolenaar MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1b.013 Problem: A user command that partly matches with a buffer-local user command and matches full with a global user command unecessarily gives an 'ambiguous command' error. Solution: Find the full global match even after a partly local match. Files: src/ex_docmd.c *** ../vim61b.012/src/ex_docmd.c Fri Feb 22 10:49:11 2002 --- src/ex_docmd.c Wed Mar 13 20:20:55 2002 *************** *** 2049,2058 **** k++; if (k == len || (*np == NUL && isdigit(eap->cmd[k]))) { ! if (k == len && found) return NULL; ! if (!found) { /* If we matched up to a digit, then there could * be another command including the digit that we --- 2049,2062 ---- k++; if (k == len || (*np == NUL && isdigit(eap->cmd[k]))) { ! /* If finding a second match, the command is ! * ambiguous. But not if a buffer-local command ! * wasn't a full match and a global command is a full ! * match. */ ! if (k == len && found && *np != NUL) return NULL; ! if (!found || (k == len && *np == NUL)) { /* If we matched up to a digit, then there could * be another command including the digit that we *************** *** 2084,2090 **** } } ! /* Stop if we found a match of searched all. */ if (j < gap->ga_len || gap == &ucmds) break; gap = &ucmds; --- 2088,2094 ---- } } ! /* Stop if we found a full match or searched all. */ if (j < gap->ga_len || gap == &ucmds) break; gap = &ucmds; *** ../vim61b.012/src/version.c Fri Mar 15 21:46:59 2002 --- src/version.c Fri Mar 15 21:49:08 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 13, /**/ -- Windows M!uqoms /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ /// Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim \\\ \\\ Project leader for A-A-P -- http://www.a-a-p.org /// \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///