From 95c899f3e25d3be8381a873d96e1769a4993b9b7 Mon Sep 17 00:00:00 2001 From: Israel Chauca Fuentes Date: Tue, 11 May 2010 09:58:17 -0500 Subject: [PATCH] Fix #16 Finish() didn't reset the char buffer. --- autoload/delimitMate.vim | 2 ++ autoload/delimitMateTests.vim | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/autoload/delimitMate.vim b/autoload/delimitMate.vim index 4af2fd2..18ce29d 100644 --- a/autoload/delimitMate.vim +++ b/autoload/delimitMate.vim @@ -490,6 +490,8 @@ function! delimitMate#Finish() " {{{ let len = len(b:delimitMate_buffer) if len > 0 let buffer = join(b:delimitMate_buffer, '') + " Reset buffer: + let b:delimitMate_buffer = [] let line = getline('.') let col = col('.') -2 "echom 'col: ' . col . '-' . line[:col] . "|" . line[col+len+1:] . '%' . buffer diff --git a/autoload/delimitMateTests.vim b/autoload/delimitMateTests.vim index 669f647..0cc8b5a 100644 --- a/autoload/delimitMateTests.vim +++ b/autoload/delimitMateTests.vim @@ -188,6 +188,10 @@ function! delimitMateTests#Main() " {{{ call Type("Backspace inside space expansion", "(\\", ['(|)'], ['expand_space:1']) call RepeatLast("Backspace inside space expansion", ['(|)(|)']) + " shouldn't insert any text + call Type(" shouldn't insert any text", "(hello\\there\\", ['(hello) there|'], []) + call RepeatLast("Backspace inside space expansion", ['(|)(|)']) + " Backspace inside CR expansion call Type("Backspace inside CR expansion", "(\\", ['(|)'], ['expand_cr:1']) call RepeatLast("Backspace inside CR expansion", ['(|)(|)'])