mirror of
https://github.com/dhruvasagar/vim-table-mode.git
synced 2025-11-12 21:13:47 -05:00
Automatically setup table options
Readme mentions settings for Markdown and ReST, but we can apply them automatically for the current filetype. If a user is editing a no filetype scratch buffer, they'll still need to configure these options themselves. But this provides better defaults when editing a buffer of these filetypes. Adds get_buffer_or_global_option that could be used for any other buffer-local (filetype-specific) options.
This commit is contained in:
@@ -67,7 +67,9 @@ function! tablemode#align#alignments(lnum, ncols) "{{{2
|
||||
let achr = g:table_mode_align_char
|
||||
let alignments = []
|
||||
if tablemode#table#IsBorder(a:lnum+1)
|
||||
let hcols = tablemode#align#Split(getline(a:lnum+1), '[' . g:table_mode_corner . g:table_mode_corner_corner . ']')
|
||||
let corner = tablemode#utils#get_buffer_or_global_option('table_mode_corner')
|
||||
let corner_corner = tablemode#utils#get_buffer_or_global_option('table_mode_corner_corner')
|
||||
let hcols = tablemode#align#Split(getline(a:lnum+1), '[' . corner . corner_corner . ']')
|
||||
for idx in range(len(hcols))
|
||||
" Right align if header
|
||||
call add(alignments, 'l')
|
||||
|
||||
Reference in New Issue
Block a user