mirror of
https://github.com/dhruvasagar/vim-table-mode.git
synced 2025-11-08 11:03:47 -05:00
Cosmetic change
changed variable name from i to jdx since for consistency, i is short for insert which is a vim ex command so to make things unambiguous.
This commit is contained in:
@@ -124,6 +124,7 @@ function! tablemode#align#alignments(lnum, ncols) "{{{2
|
|||||||
for idx in range(len(hcols))
|
for idx in range(len(hcols))
|
||||||
" Right align if header
|
" Right align if header
|
||||||
if hcols[idx] =~# g:table_mode_align_char . '$' | let alignments[idx] = 'r' | endif
|
if hcols[idx] =~# g:table_mode_align_char . '$' | let alignments[idx] = 'r' | endif
|
||||||
|
if hcols[idx] !~# '[^0-9\.]' | let alignments[idx] = 'r' | endif
|
||||||
endfor
|
endfor
|
||||||
end
|
end
|
||||||
return alignments
|
return alignments
|
||||||
@@ -166,9 +167,9 @@ function! tablemode#align#Align(lines) "{{{2
|
|||||||
let tline = lines[idx].text
|
let tline = lines[idx].text
|
||||||
|
|
||||||
if len(tline) <= 1 | continue | endif
|
if len(tline) <= 1 | continue | endif
|
||||||
for i in range(len(tline))
|
for jdx in range(len(tline))
|
||||||
let field = s:Padding(tline[i], maxes[i], alignments[i])
|
let field = s:Padding(tline[jdx], maxes[jdx], alignments[jdx])
|
||||||
let tline[i] = field . (i == 0 || i == len(tline) ? '' : ' ')
|
let tline[jdx] = field . (jdx == 0 || jdx == len(tline) ? '' : ' ')
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
let lines[idx].text = s:StripTrailingSpaces(join(tline, ''))
|
let lines[idx].text = s:StripTrailingSpaces(join(tline, ''))
|
||||||
|
|||||||
Reference in New Issue
Block a user