|
1 | 1 | " Vim OMNI completion script for SQL |
2 | 2 | " Language: SQL |
3 | 3 | " Maintainer: David Fishburn <dfishburn dot vim at gmail dot com> |
4 | | -" Version: 15.0 |
5 | | -" Last Change: 2013 May 13 |
| 4 | +" Version: 16.0 |
| 5 | +" Last Change: 2015 Dec 29 |
6 | 6 | " Homepage: http://www.vim.org/scripts/script.php?script_id=1572 |
7 | 7 | " Usage: For detailed help |
8 | 8 | " ":help sql.txt" |
|
16 | 16 | " look backwards to a FROM clause and find the first table |
17 | 17 | " and complete it. |
18 | 18 | " |
| 19 | +" Version 16.0 (Dec 2015) |
| 20 | +" - NF: If reseting the cache and table, procedure or view completion |
| 21 | +" had been used via dbext, have dbext delete or recreate the |
| 22 | +" dictionary so that new objects are picked up for the |
| 23 | +" next completion. |
| 24 | +" |
19 | 25 | " Version 15.0 (May 2013) |
20 | 26 | " - NF: Changed the SQL precached syntax items, omni_sql_precache_syntax_groups, |
21 | 27 | " to use regular expressions to pick up extended syntax group names. |
@@ -103,7 +109,7 @@ endif |
103 | 109 | if exists('g:loaded_sql_completion') |
104 | 110 | finish |
105 | 111 | endif |
106 | | -let g:loaded_sql_completion = 150 |
| 112 | +let g:loaded_sql_completion = 160 |
107 | 113 | let s:keepcpo= &cpo |
108 | 114 | set cpo&vim |
109 | 115 |
|
@@ -459,6 +465,29 @@ function! sqlcomplete#Complete(findstart, base) |
459 | 465 | let s:tbl_cols = [] |
460 | 466 | let s:syn_list = [] |
461 | 467 | let s:syn_value = [] |
| 468 | + |
| 469 | + if s:sql_file_table != "" |
| 470 | + if g:loaded_dbext >= 2300 |
| 471 | + call DB_DictionaryDelete("table") |
| 472 | + else |
| 473 | + DBCompleteTables! |
| 474 | + endif |
| 475 | + endif |
| 476 | + if s:sql_file_procedure != "" |
| 477 | + if g:loaded_dbext >= 2300 |
| 478 | + call DB_DictionaryDelete("procedure") |
| 479 | + else |
| 480 | + DBCompleteProcedures! |
| 481 | + endif |
| 482 | + endif |
| 483 | + if s:sql_file_view != "" |
| 484 | + if g:loaded_dbext >= 2300 |
| 485 | + call DB_DictionaryDelete("view") |
| 486 | + else |
| 487 | + DBCompleteViews! |
| 488 | + endif |
| 489 | + endif |
| 490 | + |
462 | 491 | let s:sql_file_table = "" |
463 | 492 | let s:sql_file_procedure = "" |
464 | 493 | let s:sql_file_view = "" |
|
0 commit comments