According to :help getregtype(), it returns 0 for empty or unknown
register.  But it returns "" for empty register.  And it returns unnamed
register's type for unknown register.

Steps to reproduce:
  $ vim -u NONE -i NONE
  :" test for empty register
  :echo getregtype('a') is ''
  :" test for unknown register
  :echo getregtype('^') is ''
  :call setreg('"', 'v')
  :echo getregtype('^') is ''

Result:
  1
  1
  0

Expected:
  1
  1
  1


I think it should be fixed as following.  Please check it.


diff -r 2f856c7c1d43 runtime/doc/eval.txt
--- a/runtime/doc/eval.txt    Sun Dec 15 10:02:33 2013 +0100
+++ b/runtime/doc/eval.txt    Thu Dec 26 21:40:45 2013 +0900
@@ -3460,7 +3460,7 @@
             "v"            for |characterwise| text
             "V"            for |linewise| text
             "<CTRL-V>{width}"    for |blockwise-visual| text
-            0            for an empty or unknown register
+            ""            for an empty or unknown register
         <CTRL-V> is one character with value 0x16.
         If {regname} is not specified, |v:register| is used.

diff -r 2f856c7c1d43 src/ops.c
--- a/src/ops.c    Sun Dec 15 10:02:33 2013 +0100
+++ b/src/ops.c    Thu Dec 26 21:40:45 2013 +0900
@@ -6240,7 +6240,9 @@
     regname = may_get_selection(regname);
 #endif

-    /* Should we check for a valid name? */
+    if (regname != NUL && !valid_yank_reg(regname, FALSE))
+        return MAUTO;
+
     get_yank_register(regname, FALSE);

     if (y_current->y_array != NULL)


-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Raspunde prin e-mail lui