Commits

ZyX_I committed 5e56d13

@/fwc: Fixed infinite cycle when {prefixes} section has list prefix and current argument does not match any prefix

Comments (0)

Files changed (3)

plugin/frawor/fwc/topconstructs.vim

             endif
         elseif haslist
             call self.if(astr.' isnot 0')
+        else
+            call self.nextthrow(astr.' is 0', 'pnf', idx, self.argstr())
         endif
         call self.increment(a:largsstr, -1)
         if hasnext
         if hasnext
             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.up()
             call self.up()
         else
+            if haslist
+                call self.nextthrow(astr.' is 0', 'pnf', idx, self.argstr())
+            endif
             call self.up()
             call self.up()
         endif
 plugin/frawor/fwc/compiler:pnf
 plugin/frawor/fwc/compiler:pnf
 plugin/frawor/fwc/compiler:noreqpref
+plugin/frawor/fwc/compiler:pnf
 ::: Section <Required, optional, actions, prefixes and next composition>
 plugin/frawor/fwc/compiler:tooshort
 <<< messages

test/fwctests.dat

 ['{abc :=(2) -}',                 'filter'], ['noa'],     0
 ['{?text - ?texthl -}',           'filter'], ['text'],    [{'text': 1}]
 ['{abc bool ?def bool}',          'filter'], ['def', {}], 0
+['{*?ab isreg}',                  'filter'], ['b'],       0
 ['{*b isreg !?a}', 'filter'], ['b', 'n', 'n'], [{'b': ['n'], 'a': 0}]
 ['{*b isreg !?a}', 'filter'], ['b', 'n', 'c'], [{'b': ['n', 'c']}]
 #▶1 Required, optional, actions, prefixes and next composition