Commits

ZyX_I committed 2c94657

@/table: Improved stdisplaywidth emulation
@/fwc/compiler: Fixed `cur arguments inside {optional} section

Comments (0)

Files changed (4)

plugin/frawor/fwc/compiler.vim

     elseif a:var[0] is# 'string'
         let r=[self.string(a:var[1])]
     elseif a:var[0] is# 'argument'
-        let r=[self.argbase, [self.subs[0]+a:var[1]]+a:var[2:]]
+        let r=[self.argbase, [s:F.incrementsub(self.subs[0], a:var[1])]+
+                    \        a:var[2:]]
     elseif a:var[0] is# 'cur'
         let r=[self.argbase, self.subs[:-1-a:var[1]]+a:var[2:]]
     elseif a:var[0] is# 'list'

plugin/frawor/mappings.vim

 endfunction
 "▶1 opfunc        :: mtype → <expr> + ?
 function s:opfunc(mtype)
-    setlocal operatorfunc=
     let mrargs=s:mrargs
     unlet s:mrargs
     call add(mrargs, a:mtype)

plugin/frawor/table.vim

         let chars=split(a:str, '\v.@=')
         let col=get(a:000, 0, 0)
         let curcol=col
+        let notranstab=!(&list && stridx(&lcs, 'tab:')==-1)
         for char in chars
-            if char[0] is# "\t"
+            if char[0] is# "\t" && notranstab
                 let curcol+=(&ts-curcol%&ts)
             else
-                let charnr=char2nr(char[0])
-                let curcol+=1+((0xFF00< charnr && charnr<=0xFF60) ||
-                            \  (0xFFE0<=charnr && charnr<=0xFFE6) ||
-                            \  charn==0x3000)
+                if char=~#'\v^\p$'
+                    let charnr=char2nr(char[0])
+                    let curcol+=1+((0xFF00< charnr && charnr<=0xFF60) ||
+                                \  (0xFFE0<=charnr && charnr<=0xFFE6) ||
+                                \  charn==0x3000)
+                else
+                    let curcol+=len(strtrans(char))
+                endif
             endif
         endfor
         return curcol-col

test/fwctests.dat

 ['[bool] [is=2]',                        'check'], [1],          1
 ['[bool] [is=2]',                        'check'], [2],          1
 ['[bool] [is=2]',                        'check'], [3],          0
+['type {} [key @<]',                     'check'], [{'a':1},'a'],1
 ['[:=(2) bool]',                        'filter'], [],           [2]
 ['[:=(2) bool [:=(3) bool]]',           'filter'], [],           [2, 3]
 ['[:=(2) bool [:=(3) bool]]',           'filter'], [0],          [0, 3]
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.