diff --git a/README.md b/README.md index fbe8930c84fbd4883d128120e1b542fac75dda42..da71c3a5fb6264533407d63ee6db5c68c6f2ae43 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ it, here is the quick start: *Running sql queries against a DBMS*: -* set the `g:sw_config_dir` and `g:sw_exe` variables +* set the `g:sw_config_dir`, `g:sw_exe` and `g:sw_cache` variables * open your sql buffer * if you have `CtrlP` installed you can do `CtrlP` and then select `SQL Workbench profiles` and choose your profile @@ -1127,8 +1127,8 @@ and which means open with vim `edit` command * `g:sw_tab_switches_between_bottom_panels`: if set to true, then clicking tab in a db explorer will switch between the bottom panels -* `g:sw_autocomplete_cache_dir`: the location where the autocomplete - information is saved. You'll need to set it on Windows to work. +* `g:sw_cache`: the location where the cached data is going to be saved + (autocomplete data, profiles data etc.) * `g:sw_switch_to_results_tab`: If true, then switch to the results buffer after executting a query * `g:sw_highlight_resultsets`: If true, highlight the resultsets headers diff --git a/autoload/sw/autocomplete.vim b/autoload/sw/autocomplete.vim index facbfd3c8d1bf83c43d3e1189c3aa5d2fa78f918..52eb8d07ac024e65713ce5ecf58b1188e27b1995 100644 --- a/autoload/sw/autocomplete.vim +++ b/autoload/sw/autocomplete.vim @@ -695,7 +695,7 @@ endfunction function! sw#autocomplete#complete_cache_name(ArgLead, CmdLine, CursorPos) let words = split('^' . a:CmdLine, '\v\s+') - let files = split(globpath(g:sw_autocomplete_cache_dir, '*'), "\n") + let files = split(globpath(g:sw_cache, '*'), "\n") let result = [] for file in files let f = substitute(file, '\v\c^.*\/([^\/\.]+)\.?.*$', '\1', 'g') diff --git a/autoload/sw/profiles.vim b/autoload/sw/profiles.vim index feb06bc0b818013275f5ea7c80b4dd687ee0b3ef..c66cb76c734740a5fbb5b84f4326d77b127d4bcc 100644 --- a/autoload/sw/profiles.vim +++ b/autoload/sw/profiles.vim @@ -1,5 +1,5 @@ function! s:get_name() - return g:sw_autocomplete_cache_dir . '/' . 'profiles.vim' + return g:sw_cache . '/' . 'profiles.vim' endfunction function! sw#profiles#update(channel) @@ -25,6 +25,9 @@ function! sw#profiles#about(profile, txt) endfunction function! sw#profiles#finish(profile, txt) + if !(a:txt =~ 'XSLT transformation.*finished successfully') + call sw#display_error("There was a problem fetching the profiles for Sql Workbench (maybe the g:sw_cache) variable is not set?") + endif endfunction function! sw#profiles#get() diff --git a/autoload/sw/report.vim b/autoload/sw/report.vim index 34262442b922bb074428fdc99765736253ee57f9..25c46f3dad9f44a993c319caa0c8495990b99e82 100644 --- a/autoload/sw/report.vim +++ b/autoload/sw/report.vim @@ -15,7 +15,7 @@ function! sw#report#get(profile) endfunction function! s:get_name(profile) - return g:sw_autocomplete_cache_dir . '/' . substitute(a:profile, '\v\', '-', 'g') + return g:sw_cache . '/' . substitute(a:profile, '\v\', '-', 'g') endfunction function! s:get_report(profile) diff --git a/doc/vim-sql-workbench.txt b/doc/vim-sql-workbench.txt index 96fbf34894cbb682f83ab4a0130854abb12dfa6a..614f115ca8c0900e023fb827a49ae31f281b302e 100644 --- a/doc/vim-sql-workbench.txt +++ b/doc/vim-sql-workbench.txt @@ -30,7 +30,7 @@ it, here is the quick start: Running sql queries against a DBMS: -* set the `g:sw_config_dir` and `g:sw_exe` variables +* set the `g:sw_config_dir`, `g:sw_exe` and `g:sw_cache` variables * open your sql buffer * if you have `CtrlP` installed you can do `CtrlP` and then select and choose your profile * otherwise, you can do `:SWSqlBufferConnect` and then in the buffer execute @@ -1179,8 +1179,8 @@ SQL BUFFER SETTINGS: *vim-sql-workbench-sql_buffer_settings which means open with vim `edit` command * `g:sw_tab_switches_between_bottom_panels`: if set to true, then clicking tab in a db explorer will switch between the bottom panels -* `g:sw_autocomplete_cache_dir`: the location where the autocomplete - information is saved. You'll need to set it on Windows to work. +* `g:sw_cache`: the location where the cached data is going to be saved + (autocomplete data, profiles data etc.) * `g:sw_switch_to_results_tab`: If true, then switch to the results buffer after executting a query * `g:sw_highlight_resultsets`: If true, highlight the resultsets headers @@ -1213,4 +1213,3 @@ GENERAL SETTINGS: *vim-sql-workbench-general_settings use `SWSqlWipeoutResultsSets` command. * `g:sw_config_dir`: the config dir of the (works only with build 121.4 and more) - diff --git a/plugin/sw.vim b/plugin/sw.vim index dbda232204018bb01c5952891996350df220af6a..87c4572a525445698a50aeeb14b7f137f5409df8 100644 --- a/plugin/sw.vim +++ b/plugin/sw.vim @@ -65,8 +65,8 @@ if !exists('g:sw_search_default_compare_types') let g:sw_search_default_compare_types = 'contains' endif -if !exists('g:sw_autocomplete_cache_dir') - let g:sw_autocomplete_cache_dir = $HOME . '/.cache/sw' +if !exists('g:cache') + let g:sw_cache = $HOME . '/.cache/sw' endif if (!exists('g:sw_delimiter'))