From f476dd0f20b73c92ddf14c6badec6136b396780a Mon Sep 17 00:00:00 2001 From: ynonp Date: Fri, 9 May 2014 23:37:43 +0300 Subject: [PATCH] Bugfix: counter had wrong initial value search() returns line numbers, so counter's initial value was the first line number that had the tag. The following HTML for example resulted in a wrong counter value, and so plugin didn't work well: a --- ftplugin/html_autoclosetag.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ftplugin/html_autoclosetag.vim b/ftplugin/html_autoclosetag.vim index bff4dc1..82b9024 100644 --- a/ftplugin/html_autoclosetag.vim +++ b/ftplugin/html_autoclosetag.vim @@ -35,7 +35,7 @@ endf fun s:CountInPage(needle) let pos = [line('.'), col('.')] call cursor(1, 1) - let counter = search(a:needle, 'Wc') + let counter = 0 while search(a:needle, 'W') if !s:InComment() | let counter += 1 | endif endw