Commits

ZyX_I  committed cf4ca75

@aurum/log: Now allowing to type normal-mode commands with count in procinput mode

  • Participants
  • Parent commits 025538e

Comments (0)

Files changed (2)

File doc/aurum.txt

     Note: Input is processed between generating two revisions. As generator is 
           normally much faster then you, then you are limited to single 
           character commands. There is a hack though that allows you to bypass 
-          this problem: if you input “g” or “z” logger won’t execute your 
-          command until it receives next character, it will also wait for <CR> 
-          ("\r" or "\n") or <Esc> after you input “/”, “?” or “:”.
+          this problem:
+            Input    Action ~
+            g, z     Waits until you input next character
+            /, ?, :  Waits until you type <CR> ("\r" or "\n") or <Esc>
+            1-9      Waits until you type next non-digit
 
 recheight                                                  *g:aurum_recheight*
     VimL |expression| that evaluates to unsigned integer or unsigned integer. 

File plugin/aurum/log.vim

            \       'buf': bufnr('%'),
            \'lastw0line': -1,
            \ 'didredraw': 0,
-           \ 'procinput': a:procinput,}
+           \ 'procinput': a:procinput,
+           \ 'allowskip': 0,}
 endfunction
 "▶3 iterfuncs.csshow.next
 function s:iterfuncs.csshow.next(d)
             let char=nr2char(char)
         endif
         let a:d.input.=char
+        let skipped=0
         if a:d.skipuntil isnot 0
             if eval(a:d.skipuntil)
                 let a:d.skipuntil=0
+                let skipped=1
             endif
+        endif
+        if (skipped && !a:d.allowskip) || a:d.skipuntil isnot 0
         elseif char is# 'g' || char is# 'z'
             let a:d.skipuntil='len(a:d.input)>='.(len(a:d.input)+1)
+            let a:d.allowskip=0
+        elseif stridx('123456789', char)!=-1
+            let a:d.skipuntil='a:d.input['.len(a:d.input).':]=~#"\\D"'
+            let a:d.allowskip=1
         elseif stridx('/?:', char)!=-1
             let a:d.skipuntil=
                         \'match(a:d.input, "[\n\r\e]", '.len(a:d.input).')!=-1'
+            let a:d.allowskip=0
         endif
     endwhile
     if !empty(a:d.input) && (a:d.skipuntil is 0 || eval(a:d.skipuntil))
         let a:d.input=''
         if bufnr('%')==a:d.buf
             let lw0=line('w0')
+            redraw!
+            redrawstatus
             if lw0!=a:d.lastw0line
-                redraw
                 let a:d.didredraw=(line('$')>=lw0+winheight(0))
                 let a:d.lastw0line=lw0
             endif