Commits

ZyX_I committed 71c1b25

Some fixes

Comments (0)

Files changed (1)

plugin/frawor/functions.vim

             let varname=element[0]
             let vnlen=len(varname)
             let hasvar=(len(element)>1)
-            "▶3 Process variables
+            "▶3 Check varname length
             if vnlen<2
                 call s:F._frawor.throw('invvnlen', a:plugdict.id, a:fname, i)
+            "▶3 Process variables
             elseif varname[1]==#':' && index(['g','b','t','w'], varname[0])!=-1
                 "▶4 Check variable name
                 if varname[2:]!~#'^\h\w*$'
                                 \ string(element[1])!~'\w')
                         let func.=string(element[1])
                     else
-                        let func.=fpref.".altervars[".i."]"
+                        let func.=fpref.".altervars[".i."][1]"
                     endif
                     let func.="\n"
                 else
                                         \                     a:fname, i)
                         endif
                         let func.=indent."let ".varname."=".
-                                    \           fpref.".altervars[".i."]\n"
+                                    \       ((type(element[1])==type(0))?
+                                    \          (element[1]):
+                                    \          (fpref.".altervars[".i."][1]\n"))
                     endif
                 endif
             "▶3 Process special
         " laltvars was defined in previous if(altervars) block
         "▲3
         while i<laltvars
+            let varname=fdef.altervars[i][0]
             " No need to check anything here: everything was checked in previous 
             " if(altervars) block
             "▶3 Process options