Mercurial > vim
comparison runtime/autoload/sqlcomplete.vim @ 25773:11b656e74444
Update runtime files
Commit: https://github.com/vim/vim/commit/6c391a74fe90190796ca0b0c010112948a6e75d7
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Sep 9 21:55:11 2021 +0200
Update runtime files
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 09 Sep 2021 22:00:10 +0200 |
parents | 3b26420fc639 |
children |
comparison
equal
deleted
inserted
replaced
25772:55753c17b73d | 25773:11b656e74444 |
---|---|
15 " - Jonas Enberg - if no table is found when using column completion | 15 " - Jonas Enberg - if no table is found when using column completion |
16 " look backwards to a FROM clause and find the first table | 16 " look backwards to a FROM clause and find the first table |
17 " and complete it. | 17 " and complete it. |
18 " | 18 " |
19 " Version 16.0 (Dec 2015) | 19 " Version 16.0 (Dec 2015) |
20 " - NF: If reseting the cache and table, procedure or view completion | 20 " - NF: If resetting the cache and table, procedure or view completion |
21 " had been used via dbext, have dbext delete or recreate the | 21 " had been used via dbext, have dbext delete or recreate the |
22 " dictionary so that new objects are picked up for the | 22 " dictionary so that new objects are picked up for the |
23 " next completion. | 23 " next completion. |
24 " | 24 " |
25 " Version 15.0 (May 2013) | 25 " Version 15.0 (May 2013) |
552 let syn_group_arr = a:1 | 552 let syn_group_arr = a:1 |
553 else | 553 else |
554 let syn_group_arr = g:omni_sql_precache_syntax_groups | 554 let syn_group_arr = g:omni_sql_precache_syntax_groups |
555 endif | 555 endif |
556 " For each group specified in the list, precache all | 556 " For each group specified in the list, precache all |
557 " the sytnax items. | 557 " the syntax items. |
558 if !empty(syn_group_arr) | 558 if !empty(syn_group_arr) |
559 for group_name in syn_group_arr | 559 for group_name in syn_group_arr |
560 let syn_items = extend( syn_items, s:SQLCGetSyntaxList(group_name) ) | 560 let syn_items = extend( syn_items, s:SQLCGetSyntaxList(group_name) ) |
561 endfor | 561 endfor |
562 endif | 562 endif |
575 let syn_group_arr = a:1 | 575 let syn_group_arr = a:1 |
576 else | 576 else |
577 let syn_group_arr = g:omni_sql_precache_syntax_groups | 577 let syn_group_arr = g:omni_sql_precache_syntax_groups |
578 endif | 578 endif |
579 " For each group specified in the list, precache all | 579 " For each group specified in the list, precache all |
580 " the sytnax items. | 580 " the syntax items. |
581 if !empty(syn_group_arr) | 581 if !empty(syn_group_arr) |
582 for group_name in syn_group_arr | 582 for group_name in syn_group_arr |
583 let list_idx = index(s:syn_list, group_name, 0, &ignorecase) | 583 let list_idx = index(s:syn_list, group_name, 0, &ignorecase) |
584 if list_idx > -1 | 584 if list_idx > -1 |
585 " Remove from list of groups | 585 " Remove from list of groups |
615 " and trigger the omni popup to be redisplayed | 615 " and trigger the omni popup to be redisplayed |
616 call feedkeys("\<C-Y>\<C-X>\<C-O>", 'n') | 616 call feedkeys("\<C-Y>\<C-X>\<C-O>", 'n') |
617 else | 617 else |
618 " If the popup is not visible, simple perform the normal | 618 " If the popup is not visible, simple perform the normal |
619 " key behaviour. | 619 " key behaviour. |
620 " Must use exec since they key must be preceeded by "\" | 620 " Must use exec since the key must be preceded by "\" |
621 " or feedkeys will simply push each character of the string | 621 " or feedkeys will simply push each character of the string |
622 " rather than the "key press". | 622 " rather than the "key press". |
623 exec 'call feedkeys("\'.g:ftplugin_sql_omni_key_right.'", "n")' | 623 exec 'call feedkeys("\'.g:ftplugin_sql_omni_key_right.'", "n")' |
624 endif | 624 endif |
625 return "" | 625 return "" |
632 " Trigger the omni popup to be redisplayed | 632 " Trigger the omni popup to be redisplayed |
633 call feedkeys("\<C-X>\<C-O>") | 633 call feedkeys("\<C-X>\<C-O>") |
634 else | 634 else |
635 " If the popup is not visible, simple perform the normal | 635 " If the popup is not visible, simple perform the normal |
636 " key behaviour. | 636 " key behaviour. |
637 " Must use exec since they key must be preceeded by "\" | 637 " Must use exec since the key must be preceded by "\" |
638 " or feedkeys will simply push each character of the string | 638 " or feedkeys will simply push each character of the string |
639 " rather than the "key press". | 639 " rather than the "key press". |
640 exec 'call feedkeys("\'.g:ftplugin_sql_omni_key_left.'", "n")' | 640 exec 'call feedkeys("\'.g:ftplugin_sql_omni_key_left.'", "n")' |
641 endif | 641 endif |
642 return "" | 642 return "" |
841 let saveSearch = @/ | 841 let saveSearch = @/ |
842 let saveWScan = &wrapscan | 842 let saveWScan = &wrapscan |
843 let curline = line(".") | 843 let curline = line(".") |
844 let curcol = col(".") | 844 let curcol = col(".") |
845 | 845 |
846 " Do not let searchs wrap | 846 " Do not let searches wrap |
847 setlocal nowrapscan | 847 setlocal nowrapscan |
848 " If . was entered, look at the word just before the . | 848 " If . was entered, look at the word just before the . |
849 " We are looking for something like this: | 849 " We are looking for something like this: |
850 " select * | 850 " select * |
851 " from customer c | 851 " from customer c |
861 " Start characterwise visual mode | 861 " Start characterwise visual mode |
862 " Advance right one character | 862 " Advance right one character |
863 " Search forward until one of the following: | 863 " Search forward until one of the following: |
864 " 1. Another select/update/delete statement | 864 " 1. Another select/update/delete statement |
865 " 2. A ; at the end of a line (the delimiter) | 865 " 2. A ; at the end of a line (the delimiter) |
866 " 3. The end of the file (incase no delimiter) | 866 " 3. The end of the file (in case no delimiter) |
867 " Yank the visually selected text into the "y register. | 867 " Yank the visually selected text into the "y register. |
868 exec 'silent! normal! vl/\c\(\<select\>\|\<update\>\|\<delete\>\|;\s*$\|\%$\)'."\n".'"yy' | 868 exec 'silent! normal! vl/\c\(\<select\>\|\<update\>\|\<delete\>\|;\s*$\|\%$\)'."\n".'"yy' |
869 | 869 |
870 let query = @y | 870 let query = @y |
871 let query = substitute(query, "\n", ' ', 'g') | 871 let query = substitute(query, "\n", ' ', 'g') |