From 06c1f316323f737e654506ce01a0dc0dfbee7593 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Tue, 28 Jan 2014 19:50:59 +0100 Subject: [PATCH] Fix &ft check in QuoteDelim: handle dotted filetypes From `:h 'filetype'`: When a dot appears in the value then this separates two filetype names. Example: /* vim: set filetype=c.doxygen : */ ~ I am using `ft=pentadactyl.vim` for my Pentadactyl/Vimperator configuration files. --- autoload/delimitMate.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/delimitMate.vim b/autoload/delimitMate.vim index 433c573..1d1cff7 100644 --- a/autoload/delimitMate.vim +++ b/autoload/delimitMate.vim @@ -382,9 +382,9 @@ function! delimitMate#QuoteDelim(char) "{{{ elseif char_at == a:char " Inside an empty pair, jump out return a:char . "\" - elseif &ft == "vim" && a:char == '"' && getline('.') =~ '^\s*$' + elseif a:char == '"' && index(split(&ft, '\.'), "vim") != -1 && getline('.') =~ '^\s*$' " If we are in a vim file and it looks like we're starting a comment, do - " not add a second + " not add a closing char. return a:char elseif delimitMate#IsSmartQuote(a:char) " Seems like a smart quote, insert a single char.