Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita021ba7

Browse files
authored
Merge pull request#100 from yous/buftype-blacklist
Add g:context_buftype_blacklist
2 parentsdddd480 +11b4a07 commita021ba7

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

‎README.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ let g:context_filetype_blacklist = []
7676
```
7777
By default, no filetypes will be ignored for the context buffer to appear. If you wish to blacklist a specific filetype, add the name of the filetype to this list.
7878

79+
```vim
80+
let g:context_buftype_blacklist = []
81+
```
82+
By default, no buftypes will be ignored for the context buffer to appear. If you wish to blacklist a specific buftype, add the name of the buftype to this list.
83+
7984
```vim
8085
let g:context_add_mappings = 1
8186
```

‎autoload/context/settings.vim‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ function! context#settings#parse() abort
2020
" filetype to this list.
2121
let filetype_blacklist=get(g:,'context_filetype_blacklist', [])
2222

23+
" if you wish to blacklist a specific buftype, add the name of the
24+
" buftype to this list.
25+
let buftype_blacklist=get(g:,'context_buftype_blacklist', [])
26+
2327
" set to 0 to disable default mappings and/or auto commands
2428
let add_mappings=get(g:,'context_add_mappings',1)
2529
let add_autocmds=get(g:,'context_add_autocmds',1)
@@ -107,15 +111,20 @@ function! context#settings#parse() abort
107111
let logfile=get(g:,'context_logfile','')
108112

109113
" transform list to lookup dictionary
110-
letblacklist= {}
114+
letfiletype_dict= {}
111115
forfiletypein filetype_blacklist
112-
let blacklist[filetype]=1
116+
let filetype_dict[filetype]=1
117+
endfor
118+
let buftype_dict= {}
119+
forbuftypein buftype_blacklist
120+
let buftype_dict[buftype]=1
113121
endfor
114122

115123
letg:context= {
116124
\'presenter': presenter,
117125
\'enabled': enabled,
118-
\'filetype_blacklist': blacklist,
126+
\'filetype_blacklist': filetype_dict,
127+
\'buftype_blacklist': buftype_dict,
119128
\'add_mappings': add_mappings,
120129
\'add_autocmds': add_autocmds,
121130
\'max_height': max_height,

‎autoload/context/util.vim‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ function! context#util#active() abort
44
return1
55
\&&w:context.enabled
66
\&&!get(g:context.filetype_blacklist, &filetype)
7+
\&&!get(g:context.buftype_blacklist, &buftype)
78
endfunction
89

910
function!context#util#map(arg)abort

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp