mirror of
https://github.com/dhruvasagar/vim-table-mode.git
synced 2025-11-11 12:33:47 -05:00
Updated Table Formulas
- Added single function for both command & mapping to take formula from input. - Reusing g:table_mode_align for formatting table content, which was missed when moving from :Tableize to tabular#TabularizeStrings - Correctly parsing ranges as strings.
This commit is contained in:
@@ -383,7 +383,13 @@ function! s:ParseRange(range, ...) "{{{2
|
||||
let default_col = a:1
|
||||
endif
|
||||
|
||||
let [rowcol1, rowcol2] = split(a:range, ':')
|
||||
if type(a:range) != type('')
|
||||
let range = string(a:range)
|
||||
else
|
||||
let range = a:range
|
||||
endif
|
||||
|
||||
let [rowcol1, rowcol2] = split(range, ':')
|
||||
let [rcs1, rcs2] = [map(split(rowcol1, ','), 'str2nr(v:val)'), map(split(rowcol2, ','), 'str2nr(v:val)')]
|
||||
|
||||
if len(rcs1) == 2
|
||||
@@ -535,7 +541,7 @@ function! tablemode#TableRealign(line) "{{{2
|
||||
let tline = tline + s:RowGap()
|
||||
endwhile
|
||||
|
||||
call tabular#TabularizeStrings(lines, g:table_mode_separator)
|
||||
call tabular#TabularizeStrings(lines, g:table_mode_separator, g:table_mode_align)
|
||||
|
||||
for lnum in lnums
|
||||
let index = index(lnums, lnum)
|
||||
|
||||
Reference in New Issue
Block a user