提交 88c1c11d 编写于 作者: R Ricardo Seriani

Added an option to disable rename sql result tab using @wbresult

上级 f238516a
......@@ -1122,6 +1122,8 @@ and
* `g:sw_log_to_file`: If true, then the logging of the communication between
`VIM` and `SQL Workbench/J` will be done in a file; otherwise, the logging
is done in memory
* `g:sw_sql_name_result_tab`: If enable, rename the result tab using @wbresult;
default value: 1
## Database explorer settings
......
......@@ -858,18 +858,22 @@ function! s:do_execute_sql(sql)
endfunction
function! sw#sqlwindow#execute_sql(sql)
let w:auto_added1 = "-- auto\n"
let w:auto_added2 = "-- end auto\n"
if (!s:check_sql_buffer())
return
endif
let _sql = a:sql
let title = substitute(a:sql, '\v[\n\r]', ' ', 'g')
if strlen(title) > 255
let title = title[:255] . '...'
endif
if g:sw_sql_name_result_tab == 1
let w:auto_added1 = "-- auto\n"
let w:auto_added2 = "-- end auto\n"
if (!s:check_sql_buffer())
return
endif
let title = substitute(a:sql, '\v[\n\r]', ' ', 'g')
if strlen(title) > 255
let title = title[:255] . '...'
endif
let _sql = '-- @wbresult ' . title . "\n" . _sql
endif
call s:do_execute_sql(_sql)
endfunction
......
......@@ -1170,6 +1170,8 @@ SQL BUFFER SETTINGS: *vim-sql-workbench-sql_buffer_settings
* `g:sw_log_to_file`: If true, then the logging of the communication between
`VIM` and will be done in a file; otherwise, the logging
is done in memory
* `g:sw_sql_name_result_tab`: If enable, rename the result tab using @wbresult;
default value: 1
--------------------------------------------------------------------------------
DATABASE EXPLORER SETTINGS *vim-sql-workbench-database_explorer_settings*
......
......@@ -145,6 +145,10 @@ if !exists('g:sw_command_timer')
let g:sw_command_timer = 1
endif
if !exists('g:sw_sql_name_result_tab')
let g:sw_sql_name_result_tab = 1
endif
"if !exists('g:sw_overwrite_current_command')
" let g:sw_overwrite_current_command = 0
"endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册