Commits

ZyX_I committed b7c3451

@/fwc: Fixed {prefixes}+{next} in some cases

  • Participants
  • Parent commits fbee2f6

Comments (0)

Files changed (2)

plugin/frawor/fwc/topconstructs.vim

         if a:type is# 'check' || a:type is# 'pipe'
             if prefopts.alt
                 call self.addif(astr.' is# '.self.string('no'.prefix))
+                if haslist
+                    call self.let(lastliststr, 0)
+                endif
                 call        self.let(prefstr, 0)
                 call        self.up()
             endif
         call        self.break()
         call self.up()
     endif
-    call self.up()
     if a:type is# 'check' || a:type is# 'pipe'
         if hasnext
-            call self.unlet(argorigstr)
+            if haslist
+                call self.nextthrow(astr.' is 0', 'pnf', idx, self.argstr())
+            elseif self.o.onlystrings
+                call self.nextthrow(astr.' is 0', 'pnf', idx, argorigstr)
+            endif
+            call self.up()
+            if haslist
+                call self.if('exists('.string(argorigstr).')')
+                call    self.unlet(argorigstr)
+                call self.up()
+                call self.up()
+            else
+                call self.unlet(argorigstr)
+            endif
             call self.up()
             call self.up()
             call self.addrestmsgs(1)
             call self.up()
         else
             call self.up()
+            call self.up()
         endif
         if !empty(reqpreflist)
             call self.nextthrow('!empty(filter(copy('.rplstr.'), '.
         endif
     else
         call self.up()
+        call self.up()
     endif
     return [[a:caidxstr], addedsavemsgs]
 endfunction

test/fwctests.dat

 ['<a ([:=(0) bool] {?!+1 ab isreg})>', 'filter'], ['a', 0], ['a', 0, {}]
 ['<a ([:=(0) bool] {ab :=(-1) bool !+1 cd :=(-1) bool})>', 'filter'], ['a', 0], ['a', 0, {'cd': -1, 'ab': -1}]
 ['<a ([:=(0) bool]) b ([:=(1) bool])>', 'filter'], ['b'], ['b', 1]
+['-onlystrings {ab isreg}  + type ""', 'filter'], ['a', ''],        [{'ab': ''}]
+['-onlystrings {ab isreg}  + type ""', 'filter'], ['a', '', ''],    [{'ab': ''}, '']
+['-onlystrings {*ab isreg} + type ""', 'filter'], ['a', '', '\v('], [{'ab': ['']}, '\v(']
+['{*b isreg !?a} + type ""', 'filter'], ['b', 'n', 'n', ''], [{'b': ['n'], 'a': 0}, '']
 # vim: cms=#%s fmr=▶,▲