Revert "table alignment: break out of loop when separator found"
This reverts commit 23d273d547
, which
fixes #655.
Description of fixed problem:
1. When looping through rows, if a separator was found, all subsequent
rows would not get an assigned alignment.
2. This breaks `s:get_aligned_rows` because it calls `s:fmt_sep` and
`s:fmt_row`, both of which expect `aligns` to have a value for every
row number.
This commit is contained in:
parent
4928132e5f
commit
3c0ae2ff97
@ -278,8 +278,7 @@ endfunction
|
|||||||
function! s:get_cell_aligns(lnum)
|
function! s:get_cell_aligns(lnum)
|
||||||
let aligns = {}
|
let aligns = {}
|
||||||
for [lnum, row] in s:get_rows(a:lnum)
|
for [lnum, row] in s:get_rows(a:lnum)
|
||||||
let found_separator = s:is_separator(row)
|
if s:is_separator(row)
|
||||||
if found_separator
|
|
||||||
let cells = vimwiki#tbl#get_cells(row)
|
let cells = vimwiki#tbl#get_cells(row)
|
||||||
for idx in range(len(cells))
|
for idx in range(len(cells))
|
||||||
let cell = cells[idx]
|
let cell = cells[idx]
|
||||||
@ -291,15 +290,15 @@ function! s:get_cell_aligns(lnum)
|
|||||||
let aligns[idx] = 'left'
|
let aligns[idx] = 'left'
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
return aligns
|
else
|
||||||
|
let cells = vimwiki#tbl#get_cells(row)
|
||||||
|
for idx in range(len(cells))
|
||||||
|
if !has_key(aligns, idx)
|
||||||
|
let aligns[idx] = 'left'
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
if !found_separator
|
|
||||||
let cells = vimwiki#tbl#get_cells(row)
|
|
||||||
for idx in range(len(cells))
|
|
||||||
let aligns[idx] = 'left'
|
|
||||||
endfor
|
|
||||||
endif
|
|
||||||
return aligns
|
return aligns
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user