From a05e3c301f4d2b88fdcd8cb3836ef029ef485b4f Mon Sep 17 00:00:00 2001 From: Cosmin Popescu Date: Sun, 6 Aug 2017 21:43:38 +0200 Subject: [PATCH] version 7.1.1 --- README.md | 6 +++--- autoload/sw/autocomplete.vim | 2 +- autoload/sw/profiles.vim | 5 ++++- autoload/sw/report.vim | 2 +- doc/vim-sql-workbench.txt | 7 +++---- plugin/sw.vim | 4 ++-- 6 files changed, 14 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index fbe8930..da71c3a 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 facbfd3..52eb8d0 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 feb06bc..c66cb76 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 3426244..25c46f3 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 96fbf34..614f115 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 dbda232..87c4572 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')) -- GitLab