Commits

Takeshi NISHIDA  committed 9740406

Added the support for perl-completion.vim.

  • Participants
  • Parent commits b89da67
  • Tags 2.14

Comments (0)

Files changed (4)

File autoload/acp.vim

 endfunction
 
 "
+function acp#meetsForPerlOmni(context)
+  return g:acp_behaviorPerlOmniLength >= 0 &&
+        \ a:context =~ '\w->\k\{' . g:acp_behaviorPerlOmniLength . ',}$'
+endfunction
+
+"
 function acp#meetsForXmlOmni(context)
   return g:acp_behaviorXmlOmniLength >= 0 &&
         \ a:context =~ '\(<\|<\/\|<[^>]\+ \|<[^>]\+=\"\)\k\{' .
 この自動ポップアップには制限があり、カーソル直前の単語は大文字英字だけで構成さ
 れていなければなりません。
 
+                                                               *acp-perl-omni*
+Perl オムニ補完 ~
+
+AutoComplPop は perl-completion.vim
+(http://www.vim.org/scripts/script.php?script_id=2852) をサポートしています。
+
+この自動ポップアップを有効にするには、|g:acp_behaviorPerlOmniLength|オプション
+を 0 以上にしてください。
+
+
 ==============================================================================
 コマンド                                                        *acp-commands*
 
         Python オムニ補完の自動ポップアップを行うのに必要なカーソルの直前のキ
         ーワード文字数。負数ならこの補完は行われません。
 
+                                             *g:acp_behaviorPerlOmniLength*  >
+  let g:acp_behaviorPerlOmniLength = -1
+<
+        Perl オムニ補完の自動ポップアップを行うのに必要なカーソルの直前のキー
+        ワード文字数。負数ならこの補完は行われません。
+
+        See also: |acp-perl-omni|
+
                                               *g:acp_behaviorXmlOmniLength*  >
   let g:acp_behaviorXmlOmniLength = 0
 <
 There is the restriction on this auto-popup, that the word before cursor must
 consist only of uppercase characters.
 
+                                                               *acp-perl-omni*
+Perl Omni-Completion ~
+
+AutoComplPop supports perl-completion.vim
+(http://www.vim.org/scripts/script.php?script_id=2852).
+
+To enable auto-popup for this completion, set |g:acp_behaviorPerlOmniLength|
+option to 0 or more.
+
+
 ==============================================================================
 COMMANDS                                                        *acp-commands*
 
         attempt python omni-completion. If negative value, this completion
         will be never attempted.
 
+                                             *g:acp_behaviorPerlOmniLength*  >
+  let g:acp_behaviorPerlOmniLength = -1
+<
+        Length of keyword characters before the cursor, which are needed to
+        attempt perl omni-completion. If negative value, this completion will
+        be never attempted.
+
+        See also: |acp-perl-omni|
+
                                               *g:acp_behaviorXmlOmniLength*  >
   let g:acp_behaviorXmlOmniLength = 0
 <
 ==============================================================================
 CHANGELOG                                                      *acp-changelog*
 
+2.14
+  - Added the support for perl-completion.vim.
+
 2.13
   - Changed to sort snipMate's triggers.
   - Fixed a bug that a wasted character was inserted after snipMate's trigger

File plugin/acp.vim

         \   '*'      : [],
         \   'ruby'   : [],
         \   'python' : [],
+        \   'perl'   : [],
         \   'xml'    : [],
         \   'html'   : [],
         \   'xhtml'  : [],
         \   'repeat'  : 0,
         \ })
   "---------------------------------------------------------------------------
+  call add(behavs.perl, {
+        \   'command' : "\<C-x>\<C-o>",
+        \   'meets'   : 'acp#meetsForPerlOmni',
+        \   'repeat'  : 0,
+        \ })
+  "---------------------------------------------------------------------------
   call add(behavs.xml, {
         \   'command' : "\<C-x>\<C-o>",
         \   'meets'   : 'acp#meetsForXmlOmni',
 call s:defineOption('g:acp_behaviorRubyOmniMethodLength', 0)
 call s:defineOption('g:acp_behaviorRubyOmniSymbolLength', 1)
 call s:defineOption('g:acp_behaviorPythonOmniLength', 0)
+call s:defineOption('g:acp_behaviorPerlOmniLength', -1)
 call s:defineOption('g:acp_behaviorXmlOmniLength', 0)
 call s:defineOption('g:acp_behaviorHtmlOmniLength', 0)
 call s:defineOption('g:acp_behaviorCssOmniPropertyLength', 1)