From 8b48dce57cd6715da4c9890a88a222c948887803 Mon Sep 17 00:00:00 2001 From: Jason Chu Date: Mon, 7 Nov 2016 06:21:37 +0000 Subject: Fix off-by-one error in initial line matching --- autoload/beancount.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/beancount.vim b/autoload/beancount.vim index aea0a42..1f067b5 100644 --- a/autoload/beancount.vim +++ b/autoload/beancount.vim @@ -72,9 +72,9 @@ function! beancount#complete(findstart, base) endif endif - let l:partial_line = strpart(getline("."), 0, getpos(".")[2]) + let l:partial_line = strpart(getline("."), 0, getpos(".")[2]-1) " Match directive types - if l:partial_line =~# '^\d\d\d\d\(-\|/\)\d\d\1\d\d \S*$' + if l:partial_line =~# '^\d\d\d\d\(-\|/\)\d\d\1\d\d $' return beancount#complete_basic(s:directives, a:base, '') endif -- cgit v1.2.3-2-gb3c3