mirror of
https://github.com/dhruvasagar/vim-table-mode.git
synced 2025-11-08 11:03:47 -05:00
Add configuration option table_mode_update_time #73
This is for better experience with auto align, we override the updatetime with the value of the configuration g:table_mode_update_time. Once table mode is disabled prior defaults are restored.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
# VIM Table Mode v4.6.5 [](https://travis-ci.org/dhruvasagar/vim-table-mode)
|
# VIM Table Mode v4.6.6 [](https://travis-ci.org/dhruvasagar/vim-table-mode)
|
||||||
|
|
||||||
An awesome automatic table creator & formatter allowing one to create neat
|
An awesome automatic table creator & formatter allowing one to create neat
|
||||||
tables as you type.
|
tables as you type.
|
||||||
|
|||||||
@@ -105,11 +105,21 @@ function! s:ToggleAutoAlign() "{{{2
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:ToggleOptions() "{{{2
|
||||||
|
if tablemode#IsActive()
|
||||||
|
let b:old_update_time = &updatetime
|
||||||
|
setl updatetime = g:table_mode_update_time
|
||||||
|
else
|
||||||
|
exec 'set updatetime='.get(b:, 'old_update_time', 4000)
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! s:SetActive(bool) "{{{2
|
function! s:SetActive(bool) "{{{2
|
||||||
let b:table_mode_active = a:bool
|
let b:table_mode_active = a:bool
|
||||||
call s:ToggleSyntax()
|
call s:ToggleSyntax()
|
||||||
call s:ToggleMapping()
|
call s:ToggleMapping()
|
||||||
call s:ToggleAutoAlign()
|
call s:ToggleAutoAlign()
|
||||||
|
call s:ToggleOptions()
|
||||||
if tablemode#IsActive()
|
if tablemode#IsActive()
|
||||||
doautocmd User TableModeEnabled
|
doautocmd User TableModeEnabled
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
*table-mode.txt* Table Mode for easy table formatting
|
*table-mode.txt* Table Mode for easy table formatting
|
||||||
===============================================================================
|
===============================================================================
|
||||||
Table Mode, THE AWESOME AUTOMATIC TABLE CREATOR & FORMATTER
|
Table Mode, THE AWESOME AUTOMATIC TABLE CREATOR & FORMATTER
|
||||||
VERSION 4.6.5
|
VERSION 4.6.6
|
||||||
|
|
||||||
Author: Dhruva Sagar <http://dhruvasagar.com/>
|
Author: Dhruva Sagar <http://dhruvasagar.com/>
|
||||||
License: MIT <http://opensource.org/licenses/MIT/>
|
License: MIT <http://opensource.org/licenses/MIT/>
|
||||||
@@ -310,6 +310,12 @@ g:table_mode_auto_align *table-mode-auto-align*
|
|||||||
let g:table_mode_auto_align = 1
|
let g:table_mode_auto_align = 1
|
||||||
<
|
<
|
||||||
|
|
||||||
|
g:table_mode_update_time *table-mode-update-time*
|
||||||
|
Set the value of updatetime to be used when table mode is active,
|
||||||
|
used in combination with |table-mode-auto-align|. >
|
||||||
|
let g:table_mode_update_time = 500
|
||||||
|
<
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
MAPPINGS *table-mode-mappings*
|
MAPPINGS *table-mode-mappings*
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ call s:SetGlobalOptDefault('table_mode_sort_map', '<Leader>ts')
|
|||||||
|
|
||||||
call s:SetGlobalOptDefault('table_mode_syntax', 1)
|
call s:SetGlobalOptDefault('table_mode_syntax', 1)
|
||||||
call s:SetGlobalOptDefault('table_mode_auto_align', 1)
|
call s:SetGlobalOptDefault('table_mode_auto_align', 1)
|
||||||
|
call s:SetGlobalOptDefault('table_mode_update_time', 500)
|
||||||
|
|
||||||
function! s:TableEchoCell() "{{{1
|
function! s:TableEchoCell() "{{{1
|
||||||
if tablemode#table#IsRow('.')
|
if tablemode#table#IsRow('.')
|
||||||
|
|||||||
Reference in New Issue
Block a user