Skip to content

Commit 05e9ae7

Browse files
bagyi0vim-scripts
authored andcommitted
Version 4.20
Posted by David Fishburn. New Features - Improved support for Cygwin. If you are using a Cygwin compiled Vim (on Windows) and are accessing Windows compiled binaries (i.e. sqlplus.exe) the binary will complain since it does not understand Unix path names. Added the option g:dbext_default_use_win32_filenames which allows you to indicate the binaries must use translated Windows paths instead. (Richard) - DBGetOption displays more information. Bug Fixes - SQL Server support had issues with the queries when running DBCompleteTable, DBCompleteProcedure, DBCompleteView which also affected the sqlcomplete.vim plugin included with Vim7 (Albie Janse van Rensburg).
1 parent 56a8588 commit 05e9ae7

File tree

2 files changed

+59
-8
lines changed

2 files changed

+59
-8
lines changed

doc/dbext.txt

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*dbext.txt* For Vim version 6.0. Last change: Tue Nov 21 2006 11:45:54 AM
1+
*dbext.txt* For Vim version 6.0. Last change: Tue Dec 19 2006 10:40:50 PM
22

33

44
VIM REFERENCE MANUAL
@@ -7,7 +7,7 @@
77
David Fishburn <[email protected]>
88

99
Database extension plugin (dbext.vim) manual
10-
dbext.vim version 4.10
10+
dbext.vim version 4.20
1111

1212
For instructions on installing this file, type
1313
:help add-local-help
@@ -53,6 +53,24 @@ SourceForge: $Revision: 1.23 $
5353
------------------------------------------------------------------------------
5454
What's New *dbext-new*
5555

56+
Version 4.20
57+
58+
New Features
59+
------------
60+
- Improved support for Cygwin. If you are using a Cygwin compiled Vim (on
61+
Windows) and are accessing Windows compiled binaries (i.e. sqlplus.exe)
62+
the binary will complain since it does not understand Unix path names.
63+
Added the option g:dbext_default_use_win32_filenames which allows you to
64+
indicate the binaries must use translated Windows paths instead. (Richard)
65+
- DBGetOption displays more information.
66+
67+
Bug Fixes
68+
------------
69+
- SQL Server support had issues with the queries when running DBCompleteTable,
70+
DBCompleteProcedure, DBCompleteView which also affected the sqlcomplete.vim
71+
plugin included with Vim7 (Albie Janse van Rensburg).
72+
73+
5674
Version 4.10
5775

5876
New Features
@@ -529,6 +547,16 @@ Version 2.00
529547
plugin uses this setting. The default is enabled, to disable
530548
add the following to your vimrc: >
531549
:let g:dbext_default_dict_show_owner = 0
550+
dbext_default_use_win32_filenames
551+
< - If using Cygwin on Windows and the 3rd party binaries (sqlplus.exe,
552+
mysql.exe, dbisql.exe, ...) are Windows compiled then they will not
553+
understand Unix style filenames (with forward slashes). Setting
554+
this option to 1, forces all filenames to be referenced with
555+
double backslashes instead. It also uses the Cygwin utility,
556+
cygpath, to identify the absolute filename from a Windows
557+
perspective. The default is 0, to enable add the following to your
558+
vimrc: >
559+
:let g:dbext_default_use_win32_filenames = 1
532560
<
533561
Buffer variables
534562
You can check all options for the buffer without specifying an option name

plugin/dbext.vim

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
" dbext.vim - Commn Database Utility
22
" ---------------------------------------------------------------
3-
" Version: 4.10
3+
" Version: 4.20
44
" Maintainer: David Fishburn <[email protected]>
55
" Authors: Peter Bagyinszki <[email protected]>
66
" David Fishburn <[email protected]>
7-
" Last Modified: Tue Nov 21 2006 11:46:07 AM
7+
" Last Modified: Tue Dec 19 2006 10:39:10 PM
88
" Based On: sqlplus.vim (author: Jamis Buck)
99
" Created: 2002-05-24
1010
" Homepage: http://vim.sourceforge.net/script.php?script_id=356
@@ -23,7 +23,7 @@ if v:version < 700
2323
echomsg "dbext: Version 4.00 or higher requires Vim7. Version 3.50 can stil be used with Vim6."
2424
finish
2525
endif
26-
let g:loaded_dbext = 410
26+
let g:loaded_dbext = 420
2727

2828
" Script variable defaults, these are used internal and are never displayed
2929
" to the end user via the DBGetOption command {{{
@@ -112,6 +112,9 @@ function! s:DB_buildLists()
112112
call add(s:script_params_mv, 'history_max_entry')
113113
call add(s:script_params_mv, 'dbext_version')
114114
call add(s:script_params_mv, 'inputdialog_cancel_support')
115+
call add(s:script_params_mv, 'buffers_with_dict_files')
116+
call add(s:script_params_mv, 'use_win32_filenames')
117+
call add(s:script_params_mv, 'temp_file')
115118

116119
" DB server specific params
117120
" See below for 3 additional DB2 items
@@ -184,6 +187,20 @@ function! s:DB_buildLists()
184187
let loop_count += 1
185188
endfor
186189

190+
" Check if we are using Cygwin, if so, let the user override
191+
" the temporary filename to use backslashes
192+
if has('win32unix') && s:DB_get('use_win32_filenames') == 1
193+
let l:dbext_tempfile = system('cygpath -w '.s:dbext_tempfile)
194+
if v:shell_error
195+
call s:DB_warningMsg('dbext:Failed to convert Cygwin path:'.v:errmsg)
196+
else
197+
" If executing the Windows path inside a Cygwin shell, you must
198+
" double up the backslashes
199+
let s:dbext_tempfile = substitute(l:dbext_tempfile, '\\', '\\\\', 'g')
200+
endif
201+
" let s:dbext_tempfile = substitute(s:dbext_tempfile, '/', '\', 'g')
202+
endif
203+
187204
endfunction
188205
"}}}
189206

@@ -590,6 +607,9 @@ function! s:DB_getDefault(name)
590607
elseif a:name ==# "replace_title" |return (exists("g:dbext_default_replace_title")?g:dbext_default_replace_title.'':0)
591608
elseif a:name ==# "use_tbl_alias" |return (exists("g:dbext_default_use_tbl_alias")?g:dbext_default_use_tbl_alias.'':'a')
592609
elseif a:name ==# "delete_temp_file" |return (exists("g:dbext_default_delete_temp_file")?g:dbext_default_delete_temp_file.'':'1')
610+
elseif a:name ==# "buffers_with_dict_files" |return s:dbext_buffers_with_dict_files
611+
elseif a:name ==# "temp_file" |return s:dbext_tempfile
612+
elseif a:name ==# "use_win32_filenames" |return (exists("g:dbext_default_use_win32_filenames")?g:dbext_default_use_win32_filenames.'':'0')
593613
elseif a:name ==# "dbext_version" |return (g:loaded_dbext)
594614
elseif a:name ==# "history_file" |return (exists("g:dbext_default_history_file")?g:dbext_default_history_file.'':(has('win32')?$VIM.'/dbext_sql_history.txt':$HOME.'/dbext_sql_history.txt'))
595615
elseif a:name ==# "history_bufname" |return (fnamemodify(s:DB_get('history_file'), ":t:r"))
@@ -2897,7 +2917,7 @@ function! s:DB_SQLSRV_getListView(view_prefix)
28972917
endfunction
28982918
function! s:DB_SQLSRV_getDictionaryTable() "{{{
28992919
let result = s:DB_SQLSRV_execSql(
2900-
\ "select ".(s:DB_get('dict_show_owner')==1?"convert(varchar,u.name)||'.'||":'').
2920+
\ "select ".(s:DB_get('dict_show_owner')==1?"convert(varchar,u.name)+'.'+":'').
29012921
\ " convert(varchar,o.name) ".
29022922
\ " from sysobjects o, sysusers u ".
29032923
\ " where o.uid=u.uid ".
@@ -2908,7 +2928,7 @@ function! s:DB_SQLSRV_getDictionaryTable() "{{{
29082928
endfunction "}}}
29092929
function! s:DB_SQLSRV_getDictionaryProcedure() "{{{
29102930
let result = s:DB_SQLSRV_execSql(
2911-
\ "select ".(s:DB_get('dict_show_owner')==1?"convert(varchar,u.name)||'.'||":'').
2931+
\ "select ".(s:DB_get('dict_show_owner')==1?"convert(varchar,u.name)+'.'+":'').
29122932
\ " convert(varchar,o.name) ".
29132933
\ " from sysobjects o, sysusers u ".
29142934
\ " where o.uid=u.uid ".
@@ -2919,7 +2939,7 @@ function! s:DB_SQLSRV_getDictionaryProcedure() "{{{
29192939
endfunction "}}}
29202940
function! s:DB_SQLSRV_getDictionaryView() "{{{
29212941
let result = s:DB_SQLSRV_execSql(
2922-
\ "select ".(s:DB_get('dict_show_owner')==1?"convert(varchar,u.name)||'.'||":'').
2942+
\ "select ".(s:DB_get('dict_show_owner')==1?"convert(varchar,u.name)+'.'+":'').
29232943
\ " convert(varchar,o.name) ".
29242944
\ " from sysobjects o, sysusers u ".
29252945
\ " where o.uid=u.uid ".
@@ -3627,6 +3647,9 @@ endfunction "}}}
36273647
function! s:DB_runCmd(cmd, sql)
36283648
let s:dbext_prev_sql = a:sql
36293649

3650+
if has('win32unix') && s:DB_get('use_win32_filenames') == 1
3651+
endif
3652+
36303653
let l:display_cmd_line = s:DB_get('display_cmd_line')
36313654

36323655
if l:display_cmd_line == 1

0 commit comments

Comments
 (0)