Handle more gracefully switches between different c-family filetypes

This commit is contained in:
Maxime Coste 2016-03-03 19:28:58 +00:00
parent b7dd5056ba
commit 00673eba36

View File

@ -113,6 +113,11 @@ addhl -group /objc/code regex "@(property|synthesize|interface|implementation|pr
addhl -group /objc/code regex "\<(IBAction|IBOutlet)\>" 0:attribute addhl -group /objc/code regex "\<(IBAction|IBOutlet)\>" 0:attribute
hook global WinSetOption filetype=(c|cpp|objc) %[ hook global WinSetOption filetype=(c|cpp|objc) %[
try %{ # we might be switching from one c-family language to another
rmhooks window c-family-hooks
rmhooks window c-family-indent
}
# cleanup trailing whitespaces when exiting insert mode # cleanup trailing whitespaces when exiting insert mode
hook window InsertEnd .* -group c-family-hooks %{ try %{ exec -draft <a-x>s^\h+$<ret>d } } hook window InsertEnd .* -group c-family-hooks %{ try %{ exec -draft <a-x>s^\h+$<ret>d } }