annotate runtime/autoload/ada.vim @ 34273:f4ae2a159bde v9.1.0075

patch 9.1.0075: insert completion not correct when adding new leader Commit: https://github.com/vim/vim/commit/cbb46b439888e10f87baaca504eafd191723c44b Author: glepnir <glephunter@gmail.com> Date: Sat Feb 3 18:11:13 2024 +0100 patch 9.1.0075: insert completion not correct when adding new leader Problem: insert completion not correct when adding new leader Solution: Reset compl_curr_match to compl_shown_match (glepnir) closes: #13957 Co-authored-by: glepnir <glephunter@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sat, 03 Feb 2024 18:30:03 +0100
parents 11b656e74444
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1125
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
1 "------------------------------------------------------------------------------
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
2 " Description: Perform Ada specific completion & tagging.
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
3 " Language: Ada (2005)
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1668
diff changeset
4 " $Id: ada.vim 887 2008-07-08 14:29:01Z krischik $
10895
c391bfbdb452 Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 3496
diff changeset
5 " Maintainer: Mathias Brousset <mathiasb17@gmail.com>
c391bfbdb452 Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 3496
diff changeset
6 " Martin Krischik <krischik@users.sourceforge.net>
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
7 " Taylor Venable <taylor@metasyntax.net>
1125
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
8 " Neil Bird <neil@fnxweb.com>
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
9 " Ned Okie <nokie@radford.edu>
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1668
diff changeset
10 " $Author: krischik $
10895
c391bfbdb452 Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 3496
diff changeset
11 " $Date: 2017-01-31 20:20:05 +0200 (Mon, 01 Jan 2017) $
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
12 " Version: 4.6
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1668
diff changeset
13 " $Revision: 887 $
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
14 " $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/ada.vim $
1125
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
15 " History: 24.05.2006 MK Unified Headers
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
16 " 26.05.2006 MK ' should not be in iskeyword.
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
17 " 16.07.2006 MK Ada-Mode as vim-ball
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
18 " 02.10.2006 MK Better folding.
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
19 " 15.10.2006 MK Bram's suggestion for runtime integration
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
20 " 05.11.2006 MK Bram suggested not to use include protection for
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
21 " autoload
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
22 " 05.11.2006 MK Bram suggested to save on spaces
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
23 " 08.07.2007 TV fix mapleader problems.
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
24 " 09.05.2007 MK Session just won't work no matter how much
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
25 " tweaking is done
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
26 " 19.09.2007 NO still some mapleader problems
10895
c391bfbdb452 Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 3496
diff changeset
27 " 31.01.2017 MB fix more mapleader problems
1125
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
28 " Help Page: ft-ada-functions
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
29 "------------------------------------------------------------------------------
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
30
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
31 if version < 700
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
32 finish
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
33 endif
3496
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
34 let s:keepcpo= &cpo
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
35 set cpo&vim
1125
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
36
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
37 " Section: Constants {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
38 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
39 let g:ada#DotWordRegex = '\a\w*\(\_s*\.\_s*\a\w*\)*'
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
40 let g:ada#WordRegex = '\a\w*'
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
41 let g:ada#Comment = "\\v^(\"[^\"]*\"|'.'|[^\"']){-}\\zs\\s*--.*"
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
42 let g:ada#Keywords = []
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
43
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
44 " Section: g:ada#Keywords {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
45 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
46 " Section: add Ada keywords {{{2
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
47 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
48 for Item in ['abort', 'else', 'new', 'return', 'abs', 'elsif', 'not', 'reverse', 'abstract', 'end', 'null', 'accept', 'entry', 'select', 'access', 'exception', 'of', 'separate', 'aliased', 'exit', 'or', 'subtype', 'all', 'others', 'synchronized', 'and', 'for', 'out', 'array', 'function', 'overriding', 'tagged', 'at', 'task', 'generic', 'package', 'terminate', 'begin', 'goto', 'pragma', 'then', 'body', 'private', 'type', 'if', 'procedure', 'case', 'in', 'protected', 'until', 'constant', 'interface', 'use', 'is', 'raise', 'declare', 'range', 'when', 'delay', 'limited', 'record', 'while', 'delta', 'loop', 'rem', 'with', 'digits', 'renames', 'do', 'mod', 'requeue', 'xor']
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
49 let g:ada#Keywords += [{
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
50 \ 'word': Item,
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
51 \ 'menu': 'keyword',
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
52 \ 'info': 'Ada keyword.',
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
53 \ 'kind': 'k',
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
54 \ 'icase': 1}]
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
55 endfor
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
56
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
57 " Section: GNAT Project Files {{{3
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
58 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
59 if exists ('g:ada_with_gnat_project_files')
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
60 for Item in ['project']
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
61 let g:ada#Keywords += [{
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
62 \ 'word': Item,
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
63 \ 'menu': 'keyword',
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
64 \ 'info': 'GNAT projectfile keyword.',
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
65 \ 'kind': 'k',
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
66 \ 'icase': 1}]
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
67 endfor
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
68 endif
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
69
25773
11b656e74444 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12756
diff changeset
70 " Section: add standard exception {{{2
1125
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
71 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
72 for Item in ['Constraint_Error', 'Program_Error', 'Storage_Error', 'Tasking_Error', 'Status_Error', 'Mode_Error', 'Name_Error', 'Use_Error', 'Device_Error', 'End_Error', 'Data_Error', 'Layout_Error', 'Length_Error', 'Pattern_Error', 'Index_Error', 'Translation_Error', 'Time_Error', 'Argument_Error', 'Tag_Error', 'Picture_Error', 'Terminator_Error', 'Conversion_Error', 'Pointer_Error', 'Dereference_Error', 'Update_Error']
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
73 let g:ada#Keywords += [{
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
74 \ 'word': Item,
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
75 \ 'menu': 'exception',
25773
11b656e74444 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12756
diff changeset
76 \ 'info': 'Ada standard exception.',
1125
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
77 \ 'kind': 'x',
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
78 \ 'icase': 1}]
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
79 endfor
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
80
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
81 " Section: add GNAT exception {{{3
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
82 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
83 if exists ('g:ada_gnat_extensions')
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
84 for Item in ['Assert_Failure']
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
85 let g:ada#Keywords += [{
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
86 \ 'word': Item,
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
87 \ 'menu': 'exception',
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
88 \ 'info': 'GNAT exception.',
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
89 \ 'kind': 'x',
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
90 \ 'icase': 1}]
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
91 endfor
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
92 endif
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
93
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
94 " Section: add Ada buildin types {{{2
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
95 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
96 for Item in ['Boolean', 'Integer', 'Natural', 'Positive', 'Float', 'Character', 'Wide_Character', 'Wide_Wide_Character', 'String', 'Wide_String', 'Wide_Wide_String', 'Duration']
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
97 let g:ada#Keywords += [{
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
98 \ 'word': Item,
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
99 \ 'menu': 'type',
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
100 \ 'info': 'Ada buildin type.',
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
101 \ 'kind': 't',
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
102 \ 'icase': 1}]
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
103 endfor
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
104
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
105 " Section: add GNAT buildin types {{{3
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
106 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
107 if exists ('g:ada_gnat_extensions')
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
108 for Item in ['Short_Integer', 'Short_Short_Integer', 'Long_Integer', 'Long_Long_Integer', 'Short_Float', 'Short_Short_Float', 'Long_Float', 'Long_Long_Float']
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
109 let g:ada#Keywords += [{
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
110 \ 'word': Item,
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
111 \ 'menu': 'type',
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
112 \ 'info': 'GNAT buildin type.',
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
113 \ 'kind': 't',
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
114 \ 'icase': 1}]
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
115 endfor
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
116 endif
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
117
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
118 " Section: add Ada Attributes {{{2
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
119 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
120 for Item in ['''Access', '''Address', '''Adjacent', '''Aft', '''Alignment', '''Base', '''Bit_Order', '''Body_Version', '''Callable', '''Caller', '''Ceiling', '''Class', '''Component_Size', '''Compose', '''Constrained', '''Copy_Sign', '''Count', '''Definite', '''Delta', '''Denorm', '''Digits', '''Emax', '''Exponent', '''External_Tag', '''Epsilon', '''First', '''First_Bit', '''Floor', '''Fore', '''Fraction', '''Identity', '''Image', '''Input', '''Large', '''Last', '''Last_Bit', '''Leading_Part', '''Length', '''Machine', '''Machine_Emax', '''Machine_Emin', '''Machine_Mantissa', '''Machine_Overflows', '''Machine_Radix', '''Machine_Rounding', '''Machine_Rounds', '''Mantissa', '''Max', '''Max_Size_In_Storage_Elements', '''Min', '''Mod', '''Model', '''Model_Emin', '''Model_Epsilon', '''Model_Mantissa', '''Model_Small', '''Modulus', '''Output', '''Partition_ID', '''Pos', '''Position', '''Pred', '''Priority', '''Range', '''Read', '''Remainder', '''Round', '''Rounding', '''Safe_Emax', '''Safe_First', '''Safe_Large', '''Safe_Last', '''Safe_Small', '''Scale', '''Scaling', '''Signed_Zeros', '''Size', '''Small', '''Storage_Pool', '''Storage_Size', '''Stream_Size', '''Succ', '''Tag', '''Terminated', '''Truncation', '''Unbiased_Rounding', '''Unchecked_Access', '''Val', '''Valid', '''Value', '''Version', '''Wide_Image', '''Wide_Value', '''Wide_Wide_Image', '''Wide_Wide_Value', '''Wide_Wide_Width', '''Wide_Width', '''Width', '''Write']
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
121 let g:ada#Keywords += [{
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
122 \ 'word': Item,
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
123 \ 'menu': 'attribute',
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
124 \ 'info': 'Ada attribute.',
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
125 \ 'kind': 'a',
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
126 \ 'icase': 1}]
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
127 endfor
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
128
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
129 " Section: add GNAT Attributes {{{3
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
130 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
131 if exists ('g:ada_gnat_extensions')
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
132 for Item in ['''Abort_Signal', '''Address_Size', '''Asm_Input', '''Asm_Output', '''AST_Entry', '''Bit', '''Bit_Position', '''Code_Address', '''Default_Bit_Order', '''Elaborated', '''Elab_Body', '''Elab_Spec', '''Emax', '''Enum_Rep', '''Epsilon', '''Fixed_Value', '''Has_Access_Values', '''Has_Discriminants', '''Img', '''Integer_Value', '''Machine_Size', '''Max_Interrupt_Priority', '''Max_Priority', '''Maximum_Alignment', '''Mechanism_Code', '''Null_Parameter', '''Object_Size', '''Passed_By_Reference', '''Range_Length', '''Storage_Unit', '''Target_Name', '''Tick', '''To_Address', '''Type_Class', '''UET_Address', '''Unconstrained_Array', '''Universal_Literal_String', '''Unrestricted_Access', '''VADS_Size', '''Value_Size', '''Wchar_T_Size', '''Word_Size']
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
133 let g:ada#Keywords += [{
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
134 \ 'word': Item,
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
135 \ 'menu': 'attribute',
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
136 \ 'info': 'GNAT attribute.',
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
137 \ 'kind': 'a',
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
138 \ 'icase': 1}]
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
139 endfor
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
140 endif
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
141
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
142 " Section: add Ada Pragmas {{{2
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
143 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
144 for Item in ['All_Calls_Remote', 'Assert', 'Assertion_Policy', 'Asynchronous', 'Atomic', 'Atomic_Components', 'Attach_Handler', 'Controlled', 'Convention', 'Detect_Blocking', 'Discard_Names', 'Elaborate', 'Elaborate_All', 'Elaborate_Body', 'Export', 'Import', 'Inline', 'Inspection_Point', 'Interface (Obsolescent)', 'Interrupt_Handler', 'Interrupt_Priority', 'Linker_Options', 'List', 'Locking_Policy', 'Memory_Size (Obsolescent)', 'No_Return', 'Normalize_Scalars', 'Optimize', 'Pack', 'Page', 'Partition_Elaboration_Policy', 'Preelaborable_Initialization', 'Preelaborate', 'Priority', 'Priority_Specific_Dispatching', 'Profile', 'Pure', 'Queueing_Policy', 'Relative_Deadline', 'Remote_Call_Interface', 'Remote_Types', 'Restrictions', 'Reviewable', 'Shared (Obsolescent)', 'Shared_Passive', 'Storage_Size', 'Storage_Unit (Obsolescent)', 'Suppress', 'System_Name (Obsolescent)', 'Task_Dispatching_Policy', 'Unchecked_Union', 'Unsuppress', 'Volatile', 'Volatile_Components']
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
145 let g:ada#Keywords += [{
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
146 \ 'word': Item,
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
147 \ 'menu': 'pragma',
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
148 \ 'info': 'Ada pragma.',
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
149 \ 'kind': 'p',
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
150 \ 'icase': 1}]
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
151 endfor
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
152
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
153 " Section: add GNAT Pragmas {{{3
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
154 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
155 if exists ('g:ada_gnat_extensions')
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
156 for Item in ['Abort_Defer', 'Ada_83', 'Ada_95', 'Ada_05', 'Annotate', 'Ast_Entry', 'C_Pass_By_Copy', 'Comment', 'Common_Object', 'Compile_Time_Warning', 'Complex_Representation', 'Component_Alignment', 'Convention_Identifier', 'CPP_Class', 'CPP_Constructor', 'CPP_Virtual', 'CPP_Vtable', 'Debug', 'Elaboration_Checks', 'Eliminate', 'Export_Exception', 'Export_Function', 'Export_Object', 'Export_Procedure', 'Export_Value', 'Export_Valued_Procedure', 'Extend_System', 'External', 'External_Name_Casing', 'Finalize_Storage_Only', 'Float_Representation', 'Ident', 'Import_Exception', 'Import_Function', 'Import_Object', 'Import_Procedure', 'Import_Valued_Procedure', 'Initialize_Scalars', 'Inline_Always', 'Inline_Generic', 'Interface_Name', 'Interrupt_State', 'Keep_Names', 'License', 'Link_With', 'Linker_Alias', 'Linker_Section', 'Long_Float', 'Machine_Attribute', 'Main_Storage', 'Obsolescent', 'Passive', 'Polling', 'Profile_Warnings', 'Propagate_Exceptions', 'Psect_Object', 'Pure_Function', 'Restriction_Warnings', 'Source_File_Name', 'Source_File_Name_Project', 'Source_Reference', 'Stream_Convert', 'Style_Checks', 'Subtitle', 'Suppress_All', 'Suppress_Exception_Locations', 'Suppress_Initialization', 'Task_Info', 'Task_Name', 'Task_Storage', 'Thread_Body', 'Time_Slice', 'Title', 'Unimplemented_Unit', 'Universal_Data', 'Unreferenced', 'Unreserve_All_Interrupts', 'Use_VADS_Size', 'Validity_Checks', 'Warnings', 'Weak_External']
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
157 let g:ada#Keywords += [{
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
158 \ 'word': Item,
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
159 \ 'menu': 'pragma',
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
160 \ 'info': 'GNAT pragma.',
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
161 \ 'kind': 'p',
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
162 \ 'icase': 1}]
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
163 endfor
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
164 endif
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
165 " 1}}}
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
166
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
167 " Section: g:ada#Ctags_Kinds {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
168 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
169 let g:ada#Ctags_Kinds = {
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
170 \ 'P': ["packspec", "package specifications"],
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
171 \ 'p': ["package", "packages"],
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
172 \ 'T': ["typespec", "type specifications"],
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
173 \ 't': ["type", "types"],
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
174 \ 'U': ["subspec", "subtype specifications"],
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
175 \ 'u': ["subtype", "subtypes"],
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
176 \ 'c': ["component", "record type components"],
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
177 \ 'l': ["literal", "enum type literals"],
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
178 \ 'V': ["varspec", "variable specifications"],
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
179 \ 'v': ["variable", "variables"],
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
180 \ 'f': ["formal", "generic formal parameters"],
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
181 \ 'n': ["constant", "constants"],
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
182 \ 'x': ["exception", "user defined exceptions"],
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
183 \ 'R': ["subprogspec", "subprogram specifications"],
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
184 \ 'r': ["subprogram", "subprograms"],
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
185 \ 'K': ["taskspec", "task specifications"],
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
186 \ 'k': ["task", "tasks"],
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
187 \ 'O': ["protectspec", "protected data specifications"],
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
188 \ 'o': ["protected", "protected data"],
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
189 \ 'E': ["entryspec", "task/protected data entry specifications"],
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
190 \ 'e': ["entry", "task/protected data entries"],
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
191 \ 'b': ["label", "labels"],
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
192 \ 'i': ["identifier", "loop/declare identifiers"],
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
193 \ 'a': ["autovar", "automatic variables"],
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
194 \ 'y': ["annon", "loops and blocks with no identifier"]}
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
195
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
196 " Section: ada#Word (...) {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
197 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
198 " Extract current Ada word across multiple lines
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
199 " AdaWord ([line, column])\
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
200 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
201 function ada#Word (...)
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
202 if a:0 > 1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
203 let l:Line_Nr = a:1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
204 let l:Column_Nr = a:2 - 1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
205 else
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
206 let l:Line_Nr = line('.')
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
207 let l:Column_Nr = col('.') - 1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
208 endif
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
209
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
210 let l:Line = substitute (getline (l:Line_Nr), g:ada#Comment, '', '' )
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
211
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
212 " Cope with tag searching for items in comments; if we are, don't loop
25773
11b656e74444 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12756
diff changeset
213 " backwards looking for previous lines
1125
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
214 if l:Column_Nr > strlen(l:Line)
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
215 " We were in a comment
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
216 let l:Line = getline(l:Line_Nr)
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
217 let l:Search_Prev_Lines = 0
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
218 else
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
219 let l:Search_Prev_Lines = 1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
220 endif
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
221
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
222 " Go backwards until we find a match (Ada ID) that *doesn't* include our
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
223 " location - i.e., the previous ID. This is because the current 'correct'
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
224 " match will toggle matching/not matching as we traverse characters
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
225 " backwards. Thus, we have to find the previous unrelated match, exclude
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
226 " it, then use the next full match (ours).
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
227 " Remember to convert vim column 'l:Column_Nr' [1..n] to string offset [0..(n-1)]
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
228 " ... but start, here, one after the required char.
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
229 let l:New_Column = l:Column_Nr + 1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
230 while 1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
231 let l:New_Column = l:New_Column - 1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
232 if l:New_Column < 0
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
233 " Have to include previous l:Line from file
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
234 let l:Line_Nr = l:Line_Nr - 1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
235 if l:Line_Nr < 1 || !l:Search_Prev_Lines
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
236 " Start of file or matching in a comment
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
237 let l:Line_Nr = 1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
238 let l:New_Column = 0
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
239 let l:Our_Match = match (l:Line, g:ada#WordRegex )
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
240 break
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
241 endif
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
242 " Get previous l:Line, and prepend it to our search string
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
243 let l:New_Line = substitute (getline (l:Line_Nr), g:ada#Comment, '', '' )
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
244 let l:New_Column = strlen (l:New_Line) - 1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
245 let l:Column_Nr = l:Column_Nr + l:New_Column
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
246 let l:Line = l:New_Line . l:Line
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
247 endif
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
248 " Check to see if this is a match excluding 'us'
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
249 let l:Match_End = l:New_Column +
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
250 \ matchend (strpart (l:Line,l:New_Column), g:ada#WordRegex ) - 1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
251 if l:Match_End >= l:New_Column &&
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
252 \ l:Match_End < l:Column_Nr
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
253 " Yes
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
254 let l:Our_Match = l:Match_End+1 +
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
255 \ match (strpart (l:Line,l:Match_End+1), g:ada#WordRegex )
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
256 break
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
257 endif
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
258 endwhile
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
259
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
260 " Got anything?
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
261 if l:Our_Match < 0
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
262 return ''
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
263 else
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
264 let l:Line = strpart (l:Line, l:Our_Match)
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
265 endif
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
266
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
267 " Now simply add further lines until the match gets no bigger
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
268 let l:Match_String = matchstr (l:Line, g:ada#WordRegex)
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
269 let l:Last_Line = line ('$')
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
270 let l:Line_Nr = line ('.') + 1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
271 while l:Line_Nr <= l:Last_Line
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
272 let l:Last_Match = l:Match_String
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
273 let l:Line = l:Line .
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
274 \ substitute (getline (l:Line_Nr), g:ada#Comment, '', '')
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
275 let l:Match_String = matchstr (l:Line, g:ada#WordRegex)
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
276 if l:Match_String == l:Last_Match
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
277 break
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
278 endif
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
279 endwhile
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
280
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
281 " Strip whitespace & return
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
282 return substitute (l:Match_String, '\s\+', '', 'g')
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
283 endfunction ada#Word
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
284
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
285 " Section: ada#List_Tag (...) {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
286 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
287 " List tags in quickfix window
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
288 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
289 function ada#List_Tag (...)
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
290 if a:0 > 1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
291 let l:Tag_Word = ada#Word (a:1, a:2)
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
292 elseif a:0 > 0
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
293 let l:Tag_Word = a:1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
294 else
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
295 let l:Tag_Word = ada#Word ()
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
296 endif
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
297
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
298 echo "Searching for" l:Tag_Word
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
299
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
300 let l:Pattern = '^' . l:Tag_Word . '$'
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
301 let l:Tag_List = taglist (l:Pattern)
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
302 let l:Error_List = []
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
303 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
304 " add symbols
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
305 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
306 for Tag_Item in l:Tag_List
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
307 if l:Tag_Item['kind'] == ''
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
308 let l:Tag_Item['kind'] = 's'
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
309 endif
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
310
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
311 let l:Error_List += [
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
312 \ l:Tag_Item['filename'] . '|' .
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
313 \ l:Tag_Item['cmd'] . '|' .
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
314 \ l:Tag_Item['kind'] . "\t" .
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
315 \ l:Tag_Item['name'] ]
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
316 endfor
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
317 set errorformat=%f\|%l\|%m
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
318 cexpr l:Error_List
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
319 cwindow
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
320 endfunction ada#List_Tag
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
321
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
322 " Section: ada#Jump_Tag (Word, Mode) {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
323 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
324 " Word tag - include '.' and if Ada make uppercase
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
325 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
326 function ada#Jump_Tag (Word, Mode)
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
327 if a:Word == ''
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
328 " Get current word
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
329 let l:Word = ada#Word()
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
330 if l:Word == ''
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
331 throw "NOT_FOUND: no identifier found."
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
332 endif
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
333 else
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
334 let l:Word = a:Word
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
335 endif
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
336
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
337 echo "Searching for " . l:Word
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
338
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
339 try
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
340 execute a:Mode l:Word
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
341 catch /.*:E426:.*/
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
342 let ignorecase = &ignorecase
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
343 set ignorecase
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
344 execute a:Mode l:Word
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
345 let &ignorecase = ignorecase
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
346 endtry
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
347
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
348 return
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
349 endfunction ada#Jump_Tag
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
350
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
351 " Section: ada#Insert_Backspace () {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
352 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
353 " Backspace at end of line after auto-inserted commentstring '-- ' wipes it
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
354 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
355 function ada#Insert_Backspace ()
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
356 let l:Line = getline ('.')
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
357 if col ('.') > strlen (l:Line) &&
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
358 \ match (l:Line, '-- $') != -1 &&
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
359 \ match (&comments,'--') != -1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
360 return "\<bs>\<bs>\<bs>"
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
361 else
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
362 return "\<bs>"
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
363 endif
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
364
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
365 return
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
366 endfunction ada#InsertBackspace
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
367
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
368 " Section: Insert Completions {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
369 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
370 " Section: ada#User_Complete(findstart, base) {{{2
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
371 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
372 " This function is used for the 'complete' option.
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
373 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
374 function! ada#User_Complete(findstart, base)
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
375 if a:findstart == 1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
376 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
377 " locate the start of the word
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
378 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
379 let line = getline ('.')
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
380 let start = col ('.') - 1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
381 while start > 0 && line[start - 1] =~ '\i\|'''
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
382 let start -= 1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
383 endwhile
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
384 return start
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
385 else
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
386 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
387 " look up matches
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
388 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
389 let l:Pattern = '^' . a:base . '.*$'
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
390 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
391 " add keywords
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
392 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
393 for Tag_Item in g:ada#Keywords
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
394 if l:Tag_Item['word'] =~? l:Pattern
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
395 if complete_add (l:Tag_Item) == 0
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
396 return []
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
397 endif
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
398 if complete_check ()
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
399 return []
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
400 endif
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
401 endif
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
402 endfor
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
403 return []
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
404 endif
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
405 endfunction ada#User_Complete
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
406
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
407 " Section: ada#Completion (cmd) {{{2
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
408 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
409 " Word completion (^N/^R/^X^]) - force '.' inclusion
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
410 function ada#Completion (cmd)
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
411 set iskeyword+=46
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
412 return a:cmd . "\<C-R>=ada#Completion_End ()\<CR>"
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
413 endfunction ada#Completion
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
414
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
415 " Section: ada#Completion_End () {{{2
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
416 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
417 function ada#Completion_End ()
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
418 set iskeyword-=46
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
419 return ''
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
420 endfunction ada#Completion_End
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
421
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
422 " Section: ada#Create_Tags {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
423 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
424 function ada#Create_Tags (option)
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
425 if a:option == 'file'
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
426 let l:Filename = fnamemodify (bufname ('%'), ':p')
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
427 elseif a:option == 'dir'
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
428 let l:Filename =
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
429 \ fnamemodify (bufname ('%'), ':p:h') . "*.ada " .
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
430 \ fnamemodify (bufname ('%'), ':p:h') . "*.adb " .
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
431 \ fnamemodify (bufname ('%'), ':p:h') . "*.ads"
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
432 else
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
433 let l:Filename = a:option
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
434 endif
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
435 execute '!ctags --excmd=number ' . l:Filename
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
436 endfunction ada#Create_Tags
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
437
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
438 " Section: ada#Switch_Session {{{1
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
439 "
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
440 function ada#Switch_Session (New_Session)
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
441 "
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
442 " you should not save to much date into the seession since they will
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
443 " be sourced
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
444 "
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
445 let l:sessionoptions=&sessionoptions
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
446
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
447 try
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
448 set sessionoptions=buffers,curdir,folds,globals,resize,slash,tabpages,tabpages,unix,winpos,winsize
1125
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
449
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
450 if a:New_Session != v:this_session
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
451 "
10895
c391bfbdb452 Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 3496
diff changeset
452 " We actually got a new session - otherwise there
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
453 " is nothing to do.
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
454 "
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
455 if strlen (v:this_session) > 0
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
456 execute 'mksession! ' . v:this_session
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
457 endif
1125
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
458
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
459 let v:this_session = a:New_Session
1125
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
460
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
461 "if filereadable (v:this_session)
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
462 "execute 'source ' . v:this_session
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
463 "endif
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
464
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
465 augroup ada_session
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
466 autocmd!
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
467 autocmd VimLeavePre * execute 'mksession! ' . v:this_session
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
468 augroup END
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
469
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
470 "if exists ("g:Tlist_Auto_Open") && g:Tlist_Auto_Open
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
471 "TlistOpen
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
472 "endif
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
473
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
474 endif
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
475 finally
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
476 let &sessionoptions=l:sessionoptions
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
477 endtry
1125
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
478
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
479 return
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
480 endfunction ada#Switch_Session
1125
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
481
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
482 " Section: GNAT Pretty Printer folding {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
483 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
484 if exists('g:ada_folding') && g:ada_folding[0] == 'g'
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
485 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
486 " Lines consisting only of ')' ';' are due to a gnat pretty bug and
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
487 " have the same level as the line above (can't happen in the first
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
488 " line).
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
489 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
490 let s:Fold_Collate = '^\([;)]*$\|'
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
491
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
492 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
493 " some lone statements are folded with the line above
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
494 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
495 if stridx (g:ada_folding, 'i') >= 0
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
496 let s:Fold_Collate .= '\s\+\<is\>$\|'
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
497 endif
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
498 if stridx (g:ada_folding, 'b') >= 0
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
499 let s:Fold_Collate .= '\s\+\<begin\>$\|'
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
500 endif
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
501 if stridx (g:ada_folding, 'p') >= 0
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
502 let s:Fold_Collate .= '\s\+\<private\>$\|'
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
503 endif
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
504 if stridx (g:ada_folding, 'x') >= 0
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
505 let s:Fold_Collate .= '\s\+\<exception\>$\|'
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
506 endif
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
507
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
508 " We also handle empty lines and
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
509 " comments here.
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
510 let s:Fold_Collate .= '--\)'
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
511
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
512 function ada#Pretty_Print_Folding (Line) " {{{2
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
513 let l:Text = getline (a:Line)
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
514
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
515 if l:Text =~ s:Fold_Collate
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
516 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
517 " fold with line above
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
518 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
519 let l:Level = "="
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
520 elseif l:Text =~ '^\s\+('
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
521 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
522 " gnat outdents a line which stards with a ( by one characters so
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
523 " that parameters which follow are aligned.
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
524 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
525 let l:Level = (indent (a:Line) + 1) / &shiftwidth
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
526 else
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
527 let l:Level = indent (a:Line) / &shiftwidth
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
528 endif
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
529
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
530 return l:Level
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
531 endfunction ada#Pretty_Print_Folding " }}}2
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
532 endif
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
533
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
534 " Section: Options and Menus {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
535 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
536 " Section: ada#Switch_Syntax_Options {{{2
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
537 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
538 function ada#Switch_Syntax_Option (option)
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
539 syntax off
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
540 if exists ('g:ada_' . a:option)
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
541 unlet g:ada_{a:option}
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
542 echo a:option . 'now off'
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
543 else
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
544 let g:ada_{a:option}=1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
545 echo a:option . 'now on'
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
546 endif
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
547 syntax on
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
548 endfunction ada#Switch_Syntax_Option
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
549
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
550 " Section: ada#Map_Menu {{{2
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
551 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
552 function ada#Map_Menu (Text, Keys, Command)
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
553 if a:Keys[0] == ':'
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
554 execute
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
555 \ "50amenu " .
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
556 \ "Ada." . escape(a:Text, ' ') .
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
557 \ "<Tab>" . a:Keys .
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
558 \ " :" . a:Command . "<CR>"
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
559 execute
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
560 \ "command -buffer " .
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
561 \ a:Keys[1:] .
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
562 \" :" . a:Command . "<CR>"
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
563 elseif a:Keys[0] == '<'
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
564 execute
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
565 \ "50amenu " .
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
566 \ "Ada." . escape(a:Text, ' ') .
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
567 \ "<Tab>" . a:Keys .
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
568 \ " :" . a:Command . "<CR>"
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
569 execute
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
570 \ "nnoremap <buffer> " .
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
571 \ a:Keys .
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
572 \" :" . a:Command . "<CR>"
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
573 execute
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
574 \ "inoremap <buffer> " .
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
575 \ a:Keys .
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
576 \" <C-O>:" . a:Command . "<CR>"
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
577 else
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
578 if exists("g:mapleader")
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
579 let l:leader = g:mapleader
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
580 else
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
581 let l:leader = '\'
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
582 endif
1125
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
583 execute
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
584 \ "50amenu " .
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
585 \ "Ada." . escape(a:Text, ' ') .
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
586 \ "<Tab>" . escape(l:leader . "a" . a:Keys , '\') .
1125
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
587 \ " :" . a:Command . "<CR>"
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
588 execute
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
589 \ "nnoremap <buffer>" .
10895
c391bfbdb452 Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 3496
diff changeset
590 \ " <Leader>a" . a:Keys .
1125
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
591 \" :" . a:Command
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
592 execute
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
593 \ "inoremap <buffer>" .
12756
3b26420fc639 Long overdue runtime update.
Christian Brabandt <cb@256bit.org>
parents: 10895
diff changeset
594 \ " <Leader>a" . a:Keys .
1125
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
595 \" <C-O>:" . a:Command
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
596 endif
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
597 return
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
598 endfunction
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
599
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
600 " Section: ada#Map_Popup {{{2
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
601 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
602 function ada#Map_Popup (Text, Keys, Command)
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
603 if exists("g:mapleader")
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
604 let l:leader = g:mapleader
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
605 else
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
606 let l:leader = '\'
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
607 endif
1125
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
608 execute
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
609 \ "50amenu " .
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
610 \ "PopUp." . escape(a:Text, ' ') .
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
611 \ "<Tab>" . escape(l:leader . "a" . a:Keys , '\') .
1125
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
612 \ " :" . a:Command . "<CR>"
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
613
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
614 call ada#Map_Menu (a:Text, a:Keys, a:Command)
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
615 return
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
616 endfunction ada#Map_Popup
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
617
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
618 " }}}1
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
619
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
620 lockvar g:ada#WordRegex
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
621 lockvar g:ada#DotWordRegex
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
622 lockvar g:ada#Comment
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
623 lockvar! g:ada#Keywords
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
624 lockvar! g:ada#Ctags_Kinds
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
625
3496
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
626 let &cpo = s:keepcpo
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
627 unlet s:keepcpo
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
628
1125
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
629 finish " 1}}}
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
630
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
631 "------------------------------------------------------------------------------
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
632 " Copyright (C) 2006 Martin Krischik
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
633 "
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
634 " Vim is Charityware - see ":help license" or uganda.txt for licence details.
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
635 "------------------------------------------------------------------------------
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
636 " vim: textwidth=78 wrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab
96cd8222a819 updated for version 7.1a
vimboss
parents:
diff changeset
637 " vim: foldmethod=marker