diff --git a/README.md b/README.md index efc8cb6..2f0b336 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# VIM Table Mode v4.7.2 [![Build Status](https://travis-ci.org/dhruvasagar/vim-table-mode.png?branch=master)](https://travis-ci.org/dhruvasagar/vim-table-mode) +# VIM Table Mode v4.7.3 [![Build Status](https://travis-ci.org/dhruvasagar/vim-table-mode.png?branch=master)](https://travis-ci.org/dhruvasagar/vim-table-mode) An awesome automatic table creator & formatter allowing one to create neat tables as you type. diff --git a/autoload/tablemode.vim b/autoload/tablemode.vim index e00c0d8..302d2b9 100644 --- a/autoload/tablemode.vim +++ b/autoload/tablemode.vim @@ -206,9 +206,24 @@ endfunction function! tablemode#TableizeRange(...) range "{{{2 let lnum = a:firstline - while lnum < (a:firstline + (a:lastline - a:firstline + 1)) + let total = (a:lastline - a:firstline + 1) + echom total + let cntr = 1 + while cntr <= total call s:Tableizeline(lnum, a:1) undojoin + if g:table_mode_tableize_auto_border + if cntr == 1 + normal! O + call tablemode#table#AddBorder('.') + normal! j + let lnum += 1 + endif + normal! o + call tablemode#table#AddBorder('.') + let lnum += 1 + endif + let cntr += 1 let lnum += 1 endwhile diff --git a/doc/table-mode.txt b/doc/table-mode.txt index 2f67871..4e8785f 100644 --- a/doc/table-mode.txt +++ b/doc/table-mode.txt @@ -1,7 +1,7 @@ *table-mode.txt* Table Mode for easy table formatting =============================================================================== Table Mode, THE AWESOME AUTOMATIC TABLE CREATOR & FORMATTER - VERSION 4.7.2 + VERSION 4.7.3 Author: Dhruva Sagar License: MIT @@ -184,6 +184,7 @@ Overview: |table-mode-syntax| ............. Control table mode syntax |table-mode-auto-align| ......... Set if the table mode should auto align as you type + |table-mode-tableize-auto-border| Set if tableize adds row borders g:loaded_table_mode *table-mode-loaded* Use this option to disable the plugin: > @@ -358,6 +359,11 @@ g:table_mode_disable_tableize_mappings *table-mode-disable-tableize-mappings* Disables mappings for tableize. > let g:table_mode_disable_tableize_mappings = 0 < + *table-mode-tableize-auto-border* +g:table_mode_tableize_auto_border + Enables adding row borders to tables when created using tableize. > + let g:table_mode_tableize_auto_border = 0 +< =============================================================================== MAPPINGS *table-mode-mappings* diff --git a/plugin/table-mode.vim b/plugin/table-mode.vim index de11361..5a0166e 100644 --- a/plugin/table-mode.vim +++ b/plugin/table-mode.vim @@ -53,6 +53,7 @@ call s:SetGlobalOptDefault('table_mode_tableize_d_map', 'T') call s:SetGlobalOptDefault('table_mode_syntax', 1) call s:SetGlobalOptDefault('table_mode_auto_align', 1) call s:SetGlobalOptDefault('table_mode_update_time', 500) +call s:SetGlobalOptDefault('table_mode_tableize_auto_border', 0) function! s:TableEchoCell() "{{{1 if tablemode#table#IsRow('.') diff --git a/t/config/options.vim b/t/config/options.vim index d386f96..990c399 100644 --- a/t/config/options.vim +++ b/t/config/options.vim @@ -34,3 +34,4 @@ let g:table_mode_tableize_d_map = 'T' let g:table_mode_syntax = 1 let g:table_mode_auto_align = 1 let g:table_mode_update_time = 500 +let g:table_mode_tableize_auto_border = 0