Skip to content

Commit e32e3d7

Browse files
Takeshi NISHIDAvim-scripts
authored andcommitted
Version 2.9
- Changed default behavior to support XML omni completion. - Changed default value of g:acp_behaviorKeywordCommand option. The option with "\<C-p>" cause a problem which inserts a match without <CR> when 'dictionary' has been set and keyword completion is done. - Changed to show error message when incompatible with a installed vim.
1 parent fa783de commit e32e3d7

File tree

3 files changed

+40
-4
lines changed

3 files changed

+40
-4
lines changed

doc/acp.jax

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ ZIPファイルをランタイムディレクトリに展開します。
5656
+ 0文字以上のファイル名文字
5757
オムニ補完 ruby ".", "::" or 単語を構成する文字以外 + ":"
5858
オムニ補完 python "."
59+
オムニ補完 xml "<", "</" or ("<" + ">"以外の文字列 + " ")
5960
オムニ補完 html/xhtml "<", "</" or ("<" + ">"以外の文字列 + " ")
6061
オムニ補完 css (":", ";", "{", "^", "@", or "!")
6162
+ 0個または1個のスペース
@@ -130,7 +131,7 @@ ZIPファイルをランタイムディレクトリに展開します。
130131
ーン。
131132

132133
*g:acp_behaviorKeywordCommand* >
133-
let g:acp_behaviorKeywordCommand = "\<C-p>"
134+
let g:acp_behaviorKeywordCommand = "\<C-n>"
134135
<
135136
キーワード補完のコマンド。このオプションには普通 "\<C-n>" か "\<C-p>"
136137
を設定します。
@@ -165,6 +166,12 @@ ZIPファイルをランタイムディレクトリに展開します。
165166
Python オムニ補完の自動ポップアップを行うのに必要なカーソルの直前のキ
166167
ーワード文字数。負数ならこの補完は行いません。
167168

169+
*g:acp_behaviorXmlOmniLength* >
170+
let g:acp_behaviorXmlOmniLength = 0
171+
<
172+
XML オムニ補完の自動ポップアップを行うのに必要なカーソルの直前のキーワ
173+
ード文字数。負数ならこの補完は行いません。
174+
168175
*g:acp_behaviorHtmlOmniLength* >
169176
let g:acp_behaviorHtmlOmniLength = 0
170177
<

doc/acp.txt

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ default behavior is as follows:
5858
Omni ruby ".", "::" or non-word character + ":"
5959
(|+ruby| required.)
6060
Omni python "." (|+python| required.)
61+
Omni xml "<", "</" or ("<" + non-">" characters + " ")
6162
Omni html/xhtml "<", "</" or ("<" + non-">" characters + " ")
6263
Omni css (":", ";", "{", "^", "@", or "!")
6364
+ 0 or 1 space
@@ -134,7 +135,7 @@ OPTIONS *acp-options*
134135
completion.
135136

136137
*g:acp_behaviorKeywordCommand* >
137-
let g:acp_behaviorKeywordCommand = "\<C-p>"
138+
let g:acp_behaviorKeywordCommand = "\<C-n>"
138139
<
139140
Command for keyword completion. This option is usually set "\<C-n>" or
140141
"\<C-p>".
@@ -174,6 +175,13 @@ OPTIONS *acp-options*
174175
attempt python omni-completion. If negative value, this completion
175176
will be never attempted.
176177

178+
*g:acp_behaviorXmlOmniLength* >
179+
let g:acp_behaviorXmlOmniLength = 0
180+
<
181+
Length of keyword characters before a cursor, which are needed to
182+
attempt XML omni-completion. If negative value, this completion will
183+
be never attempted.
184+
177185
*g:acp_behaviorHtmlOmniLength* >
178186
let g:acp_behaviorHtmlOmniLength = 0
179187
<
@@ -229,6 +237,13 @@ SPECIAL THANKS *acp-thanks*
229237
==============================================================================
230238
CHANGELOG *acp-changelog*
231239

240+
2.9
241+
- Changed default behavior to support XML omni completion.
242+
- Changed default value of g:acp_behaviorKeywordCommand option.
243+
The option with "\<C-p>" cause a problem which inserts a match without
244+
<CR> when 'dictionary' has been set and keyword completion is done.
245+
- Changed to show error message when incompatible with a installed vim.
246+
232247
2.8.1
233248
- Fixed a bug which inserted a selected match to the next line when
234249
auto-wrapping (enabled with 'formatoptions') was performed.

plugin/acp.vim

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
"=============================================================================
66
" LOAD GUARD {{{1
77

8-
if exists('g:loaded_acp') || v:version < 702
8+
if exists('g:loaded_acp')
9+
finish
10+
elseif v:version < 702
11+
echoerr 'AutoComplPop does not support this version of vim (' . v:version . ').'
912
finish
1013
endif
1114
let g:loaded_acp = 1
@@ -27,6 +30,7 @@ function s:makeDefaultBehavior()
2730
\ '*' : [],
2831
\ 'ruby' : [],
2932
\ 'python' : [],
33+
\ 'xml' : [],
3034
\ 'html' : [],
3135
\ 'xhtml' : [],
3236
\ 'css' : [],
@@ -92,6 +96,15 @@ function s:makeDefaultBehavior()
9296
\ })
9397
endif
9498
"---------------------------------------------------------------------------
99+
if g:acp_behaviorXmlOmniLength >= 0
100+
call add(behavs.xml, {
101+
\ 'command' : "\<C-x>\<C-o>",
102+
\ 'pattern' : printf('\(<\|<\/\|<[^>]\+ \|<[^>]\+=\"\)\k\{%d,}$',
103+
\ g:acp_behaviorXmlOmniLength),
104+
\ 'repeat' : 0,
105+
\ })
106+
endif
107+
"---------------------------------------------------------------------------
95108
if g:acp_behaviorHtmlOmniLength >= 0
96109
let behavHtml = {
97110
\ 'command' : "\<C-x>\<C-o>",
@@ -136,12 +149,13 @@ call s:defineOption('g:acp_completeOption', '.,w,b,k')
136149
call s:defineOption('g:acp_completeoptPreview', 0)
137150
call s:defineOption('g:acp_behaviorUserDefinedFunction', '')
138151
call s:defineOption('g:acp_behaviorUserDefinedPattern' , '\k$')
139-
call s:defineOption('g:acp_behaviorKeywordCommand', "\<C-p>")
152+
call s:defineOption('g:acp_behaviorKeywordCommand', "\<C-n>")
140153
call s:defineOption('g:acp_behaviorKeywordLength', 2)
141154
call s:defineOption('g:acp_behaviorFileLength', 0)
142155
call s:defineOption('g:acp_behaviorRubyOmniMethodLength', 0)
143156
call s:defineOption('g:acp_behaviorRubyOmniSymbolLength', 1)
144157
call s:defineOption('g:acp_behaviorPythonOmniLength', 0)
158+
call s:defineOption('g:acp_behaviorXmlOmniLength', 0)
145159
call s:defineOption('g:acp_behaviorHtmlOmniLength', 0)
146160
call s:defineOption('g:acp_behaviorCssOmniPropertyLength', 1)
147161
call s:defineOption('g:acp_behaviorCssOmniValueLength', 0)

0 commit comments

Comments
 (0)