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:
Henry Qin 2019-04-03 11:43:00 -07:00
parent 4928132e5f
commit 3c0ae2ff97
1 changed files with 8 additions and 9 deletions

View File

@ -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
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
if !found_separator
let cells = vimwiki#tbl#get_cells(row)
for idx in range(len(cells))
let aligns[idx] = 'left'
endfor
endif
return aligns
endfunction