diff --git a/runtime/autoload/sqlcomplete.vim b/runtime/autoload/sqlcomplete.vim index aae92e6..e631824 100644 --- a/runtime/autoload/sqlcomplete.vim +++ b/runtime/autoload/sqlcomplete.vim @@ -385,35 +385,17 @@ function! sqlcomplete#Map(type) endfunction function! sqlcomplete#DrillIntoTable() - " If the omni popup window is visible - if pumvisible() - call sqlcomplete#Map('column') - " C-Y, makes the currently highlighted entry active - " and trigger the omni popup to be redisplayed - call feedkeys("\\\") - else - if has('win32') - " If the popup is not visible, simple perform the normal - " behaviour - exec "normal! \" - endif - endif + call sqlcomplete#Map('column') + " C-Y, makes the currently highlighted entry active + " and trigger the omni popup to be redisplayed + call feedkeys("\\\") return "" endfunction function! sqlcomplete#DrillOutOfColumns() - " If the omni popup window is visible - if pumvisible() - call sqlcomplete#Map('tableReset') - " Trigger the omni popup to be redisplayed - call feedkeys("\\") - else - if has('win32') - " If the popup is not visible, simple perform the normal - " behaviour - exec "normal! \" - endif - endif + call sqlcomplete#Map('tableReset') + " Trigger the omni popup to be redisplayed + call feedkeys("\\") return "" endfunction diff --git a/runtime/ftplugin/sql.vim b/runtime/ftplugin/sql.vim index f41fb5b..0cf1233 100644 --- a/runtime/ftplugin/sql.vim +++ b/runtime/ftplugin/sql.vim @@ -446,13 +446,8 @@ if exists('&omnifunc') " The next 3 maps are only to be used while the completion window is " active due to the at the beginning of the map exec 'imap '.g:ftplugin_sql_omni_key.'L :call sqlcomplete#Map("column_csv")' - " is not recognized on most Unix systems, so only create - " these additional maps on the Windows platform. - " If you would like to use these maps, choose a different key and make - " the same map in your vimrc. - " if has('win32') - exec 'imap '.g:ftplugin_sql_omni_key_right.' =sqlcomplete#DrillIntoTable()' - exec 'imap '.g:ftplugin_sql_omni_key_left.' =sqlcomplete#DrillOutOfColumns()' + exec 'imap '.g:ftplugin_sql_omni_key_right." pumvisible() ? '=sqlcomplete#DrillIntoTable()' : '".g:ftplugin_sql_omni_key_right."'" + exec 'imap '.g:ftplugin_sql_omni_key_left." pumvisible() ? '=sqlcomplete#DrillOutOfColumns()' : '".g:ftplugin_sql_omni_key_left."'" " endif " Remove any cached items useful for schema changes exec 'imap '.g:ftplugin_sql_omni_key.'R :call sqlcomplete#Map("resetCache")'