You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One feature I miss coming from Tabular is the auto generated range.
The idea is to call EasyAlign on a line containing our pattern and from there find all adjacent lines also containing the pattern: that is our range.
For adjacent lines with our pattern there is no point running an extra vip, or gaap etc... the range can easily be calculated.
Ex: :EasyAlign/\\/ -> no range given => run it on all adjacent lines containing \
Pseudo function:
" Generate a range of lines matching a patternfunction!easy#PipeRange(includepat) rangelettop=a:firstlinelet bot =a:lastline" No range has been given (top == bot), thus apply range extension logicifa:includepat!=''&&top== bot
iftop < 0||top > line('$') ||getline(top) !~a:includepatreturnendif" Extend range upwards while we match the patternwhiletop > 1&&getline(top-1) =~ a:includepatlettop-=1endwhile" Extend range downwards while we match the patternwhile bot < line('$') &&getline(bot+1) =~ a:includepatlet bot +=1endwhileendifletlines=map(range(top, bot), 'getline(v:val)')
endfunction
Hi,
One feature I miss coming from Tabular is the auto generated range.
The idea is to call EasyAlign on a line containing our pattern and from there find all adjacent lines also containing the pattern: that is our range.
For adjacent lines with our pattern there is no point running an extra
vip
, orgaap
etc... the range can easily be calculated.Ex:
:EasyAlign/\\/
-> no range given => run it on all adjacent lines containing\
Pseudo function:
Reference: https://github.com/godlygeek/tabular/blob/master/autoload/tabular.vim#L312-L353
The text was updated successfully, but these errors were encountered: