Permalink
Browse files

- Added unite#custom#substitute() for backward compatibility.

  • Loading branch information...
Shougo committed Jun 17, 2013
1 parent 5847dc7 commit 2a9abb91096d11cfabd8800bf49b17bfc85ea286
Showing with 22 additions and 2 deletions.
  1. +6 −1 autoload/unite.vim
  2. +10 −1 autoload/unite/custom.vim
  3. +6 −0 doc/unite.txt
View
@@ -1,7 +1,7 @@
"=============================================================================
" FILE: unite.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
-" Last Modified: 16 Jun 2013.
+" Last Modified: 17 Jun 2013.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
@@ -45,6 +45,11 @@ function! unite#get_profile(profile_name, option_name) "{{{
endfunction"}}}
function! unite#set_substitute_pattern(buffer_name, pattern, subst, ...) "{{{
call unite#print_error('unite#set_substitute_pattern() is deprecated.')
+ call unite#print_error('Please use unite#set_profile() '.
+ \ 'or unite#custom#substitute() instead of it.')
+endfunction"}}}
+function! unite#set_buffer_name_option(buffer_name, option_name, value) "{{{
+ call unite#print_error('unite#set_buffer_name_options() is deprecated.')
call unite#print_error('Please use unite#set_profile() instead of it.')
endfunction"}}}
View
@@ -1,7 +1,7 @@
"=============================================================================
" FILE: custom.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
-" Last Modified: 16 Jun 2013.
+" Last Modified: 17 Jun 2013.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
@@ -114,6 +114,15 @@ function! unite#custom#get_profile(profile_name, option_name) "{{{
return custom.profiles[profile_name][a:option_name]
endfunction"}}}
+function! unite#custom#substitute(profile, pattern, subst, ...) "{{{
+ let priority = get(a:000, 0, 0)
+ call unite#custom#profile(a:profile, 'substitute_patterns', {
+ \ 'pattern': a:pattern,
+ \ 'subst': a:subst,
+ \ 'priority': priority,
+ \ })
+endfunction"}}}
+
function! s:custom_base(key, kind, name, value) "{{{
let custom = unite#custom#get()[a:key]
View
@@ -1284,6 +1284,12 @@ unite#custom#profile({profile-name}, {option-name}, {value})
call unite#custom#profile('source/grep', 'context',
\ {'no_quit' : 1})
<
+unite#custom#substitute({profile-name}, {pattern}, {subst} [, {priority}])
+ *unite#custom#substitute()*
+ Specify a replace pattern of narrowing text for a Unite buffer
+ of which name is {profile-name}.
+ Note: This is wrapper function for backward compatibility.
+
unite#custom#default_action({kind}, {default-action})
*unite#custom_default_action()*
*unite#custom#default_action()*

0 comments on commit 2a9abb9

Please sign in to comment.