File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -208,6 +208,13 @@ function! s:UseConfigFiles() abort " Apply config to the current buffer {{{1
208208 let b: editorconfig_tried = 1
209209 let l: buffer_name = expand (' %:p' )
210210
211+ " Only process normal buffers (do not treat help files as '.txt' files)
212+ " When starting Vim with a directory, the buftype might not yet be set:
213+ " Therefore, also check if buffer_name is a directory.
214+ if index ([' ' , ' acwrite' ], &buftype ) == -1 || isdirectory (l: buffer_name )
215+ return
216+ endif
217+
211218 if empty (l: buffer_name )
212219 if g: EditorConfig_enable_for_new_buf
213220 let l: buffer_name = getcwd () . " /."
@@ -378,16 +385,6 @@ endfunction " }}}2
378385" }}}1
379386
380387function ! s: ApplyConfig (config) abort " Set the buffer options {{{1
381- " Only process normal buffers (do not treat help files as '.txt' files)
382- if index ([' ' , ' acwrite' ], &buftype ) == -1
383- return
384- endif
385-
386- " Do not process netrw buffers
387- if &filetype == ' netrw'
388- return
389- endif
390-
391388 if g: EditorConfig_verbose
392389 echo ' Options: ' . string (a: config )
393390 endif
You can’t perform that action at this time.
0 commit comments