-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undefined variable: b:traverser #12
Comments
The This doesn't really sound like a Pear Tree bug to me, but you could try updating to the latest version and see if you still experience this issue. |
I don't experience the error again after adding these lines. It doesn't always happens and probably happens after switching buffers so most likely a problem of concurrent execution. diff --git a/autoload/pear_tree/insert_mode.vim b/autoload/pear_tree/insert_mode.vim
index 8a53e08..75a2ce2 100644
--- a/autoload/pear_tree/insert_mode.vim
+++ b/autoload/pear_tree/insert_mode.vim
@@ -36,6 +36,7 @@ endfunction
function! s:CorrectTraverser() abort
+ call pear_tree#insert_mode#OnInsertEnter()
if s:lost_track
call b:traverser.Reset()
let s:traverser_start_pos = b:traverser.TraverseBuffer([1, 0], [line('.'), col('.') - 1])
@@ -61,6 +62,7 @@ endfunction
function! pear_tree#insert_mode#OnCursorMovedI() abort
+ call pear_tree#insert_mode#OnInsertEnter()
let l:new_line = line('.')
let l:new_col = col('.')
if l:new_line != s:current_line || l:new_col < s:current_column |
Hi,
I frequently encounter this errors:
Unfortunately I cannot consistently reproduce this error. It seems to me that the variable creation is delayed, because if I exit and reenter INSERT mode, the variable
b:traverser
is defined.The text was updated successfully, but these errors were encountered: