File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -95,12 +95,18 @@ endfunction
9595" NOTE: Moves the cursor, unless a arg is supplied.
9696function s: previous_token (... )
9797 let l: pos = getpos (' .' )[1 :2 ]
98- return [search (' .\>\|[^[:alnum:][:space:]_$]' ,' bW' ) ?
99- \ (s: looking_at () == ' /' || line (' .' ) != l: pos [0 ] && getline (' .' ) = ~ ' \/\/' ) &&
100- \ s: syn_at (line (' .' ),col (' .' )) = ~? s: syng_com ?
101- \ search (' \_[^/]\zs\/[/*]' ,' bW' ) ? s: previous_token () : ' '
102- \ : s: token ()
103- \ : ' ' ][a: 0 && call (' cursor' ,l: pos )]
98+ let token = ' '
99+ while search (' .\>\|[^[:alnum:][:space:]_$]' ,' bW' )
100+ if (s: looking_at () == ' /' || line (' .' ) != l: pos [0 ] && search (' \/\/' ,' nbW' ,
101+ \ line (' .' ))) && s: syn_at (line (' .' ),col (' .' )) = ~? s: syng_com
102+ call search (' \_[^/]\zs\/[/*]' ,' bW' )
103+ else
104+ let token = s: token ()
105+ break
106+ endif
107+ endwhile
108+ call call (' cursor' , a: 0 ? l: pos : [0 ,0 ])
109+ return token
104110endfunction
105111
106112" switch case label pattern
You can’t perform that action at this time.
0 commit comments