Hi Bram,

Here's a patch to make virtcol([123, '$']) do the right thing.
If it looks good to you, can you include it?

Alvast bedankt,

– Michael
Index: eval.c
===================================================================
--- eval.c      (revision 238)
+++ eval.c      (working copy)
@@ -16485,6 +16485,7 @@
        list_T          *l;
        int             len;
        int             error = FALSE;
+       listitem_T      *li;
 
        l = varp->vval.v_list;
        if (l == NULL)
@@ -16500,6 +16501,13 @@
        if (error)
            return NULL;
        len = (long)STRLEN(ml_get(pos.lnum));
+       /* Check for column number '$' */
+       if (pos.col == 0)
+       {
+           li = list_find(l, 1L);
+           if ((li != NULL) && (get_tv_string(&li->li_tv)[0] == '$'))
+               pos.col = len + 1;
+       }
        /* Accept a position up to the NUL after the line. */
        if (pos.col == 0 || (int)pos.col > len + 1)
            return NULL;        /* invalid column number */

Reply via email to