From 00673eba36783aad28c5618bd486aa6fee59e1a8 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 3 Mar 2016 19:28:58 +0000 Subject: [PATCH] Handle more gracefully switches between different c-family filetypes --- rc/core/c-family.kak | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rc/core/c-family.kak b/rc/core/c-family.kak index 1ddea865..abbfc8a3 100644 --- a/rc/core/c-family.kak +++ b/rc/core/c-family.kak @@ -113,6 +113,11 @@ addhl -group /objc/code regex "@(property|synthesize|interface|implementation|pr addhl -group /objc/code regex "\<(IBAction|IBOutlet)\>" 0:attribute 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 hook window InsertEnd .* -group c-family-hooks %{ try %{ exec -draft s^\h+$d } }