diff --git a/README.md b/README.md index 104e2b0d97029fc4baeac3d203ab15b7863454fe..fbe8930c84fbd4883d128120e1b542fac75dda42 100644 --- a/README.md +++ b/README.md @@ -1138,6 +1138,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 diff --git a/autoload/sw/sqlwindow.vim b/autoload/sw/sqlwindow.vim index a21556722a6f4994b1127754c9a432826f8b66cd..f3997b9112a2dbf0b054617dfb2efecf30e9687c 100644 --- a/autoload/sw/sqlwindow.vim +++ b/autoload/sw/sqlwindow.vim @@ -898,6 +898,9 @@ function! s:do_execute_sql(sql) endfunction function! s:add_title_to_sql(sql) + if g:sw_sql_name_result_tab != 1 + return a:sql + endif let _sql = a:sql let title = substitute(a:sql, '\v[\n\r]', ' ', 'g') if strlen(title) > 255 @@ -914,6 +917,7 @@ function! sw#sqlwindow#execute_sql(sql) return endif let _sql = s:add_title_to_sql(a:sql) + call s:do_execute_sql(_sql) endfunction diff --git a/doc/vim-sql-workbench.txt b/doc/vim-sql-workbench.txt index 526e180db89e9bb46561f9584d8c44e2644fdfb5..96fbf34894cbb682f83ab4a0130854abb12dfa6a 100644 --- a/doc/vim-sql-workbench.txt +++ b/doc/vim-sql-workbench.txt @@ -1190,6 +1190,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* diff --git a/plugin/sw.vim b/plugin/sw.vim index f2b61b717d0b20f6b8d9e59e31e1ae643adb2bf7..dbda232204018bb01c5952891996350df220af6a 100644 --- a/plugin/sw.vim +++ b/plugin/sw.vim @@ -149,6 +149,10 @@ if !exists('g:sw_autocomplete') let g:sw_autocomplete = 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