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)
|
||||
let aligns = {}
|
||||
for [lnum, row] in s:get_rows(a:lnum)
|
||||
let found_separator = s:is_separator(row)
|
||||
if found_separator
|
||||
if s:is_separator(row)
|
||||
let cells = vimwiki#tbl#get_cells(row)
|
||||
for idx in range(len(cells))
|
||||
let cell = cells[idx]
|
||||
@ -291,15 +290,15 @@ function! s:get_cell_aligns(lnum)
|
||||
let aligns[idx] = 'left'
|
||||
endif
|
||||
endfor
|
||||
return aligns
|
||||
endif
|
||||
endfor
|
||||
if !found_separator
|
||||
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
|
||||
endfor
|
||||
return aligns
|
||||
endfunction
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user