ZyX_I avatar ZyX_I committed 46a23ef

@/fwc/topconstructs: Finished implementation of {prefixes} section completion

Comments (0)

Files changed (2)

plugin/frawor/fwc/topconstructs.vim

     let haslist=!empty(lists)
     let lastliststr=self.getlvarid('lastlist')
     let hasnext=s:F.hasnext(a:adescr, 'prefixes')
+    "▲3
+    if haslist
+        call self.let(lastliststr, 0)
+    endif
     if self.type is 'check' || self.type is 'filter'
         "▶3 Add messages saving if required
         if hasnext
             call self.up().endif()
         endif
     else
-        call self.increment(a:caidxstr, 1)
-                    \.addif(astr.' is 0')
-                        \.break()
-                    \.up()
+        call self.addif(astr.' isnot 0')
+                    \.increment(a:caidxstr, 1)
+                \.endif()
     endif
     "▲3
     for [prefix, prefopts; args] in a:adescr.prefixes
                 call self.increment(a:largsstr, -prefopts.argnum)
             endif
         else
-            call self.let(lastliststr, prefopts.list?(prefixstr):0)
+            if haslist
+                call self.let(lastliststr, prefopts.list?(prefixstr):0)
+            endif
             let idxdiffstr=self.getlvarid('idxdiff')
             call self.if(a:caidxstr.'+'.prefopts.argnum.'<'.a:largsstr)
                         \.increment(a:caidxstr, prefopts.argnum)
         endif
         "▲3
     endfor
+    if self.type is 'complete'
+        call self.addif(astr.' is 0')
+                    \.break()
+                \.up()
+    endif
     call self.up()
     if self.type is 'check' || self.type is 'filter'
         if hasnext

test/fwccompletetests.dat

   @j 1+
   =s:list2
 
-  # @j 1 2 3+
-  # =s:list2
+  @j 1 2 3+
+  =s:list2
 
   @n
   noghi
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.