Closed thirtythreeforty closed 8 years ago
I could not reproduce this problem, sorry. Your vimrc is necessary to investigate the exact cause of that. But, I found out a related problem and I have fixed. Please try fix-39 branch.
The fix-39 branch does help somewhat. Now, instead of being unable to type spaces at all, I can type spaces, but the spacing rules are not triggered. That is, with the original rules applied, pressing spacebar here:
foo( )
bar(|)
Now results in
foo( )
bar( |)
Better, but there's still a problem. I'll try to bisect my vimrc and see if I can nail down the reason.
Update, with the following minimal vimrc
, and with only Pathogen and Lexima.vim installed, I still have the problem I described in my previous comment.
set nocompatible
runtime bundle/vim-pathogen/autoload/pathogen.vim
execute pathogen#infect()
execute pathogen#helptags()
" Extra shortcuts for lexima.vim
call lexima#add_rule({'char': ')', 'at': '(.*\%#.*)', 'leave': ')'})
call lexima#add_rule({'char': '}', 'at': '{.*\%#.*}', 'leave': '}'})
call lexima#add_rule({'char': ']', 'at': '\[.*\%#.*\]', 'leave': ']'})
" These rules trigger the bug.
call lexima#add_rule({'char': '<Space>', 'at': '( \+.*\%# \+)', 'leave': ' '})
call lexima#add_rule({'char': '<Space>', 'at': '{ \+.*\%# \+}', 'leave': ' '})
call lexima#add_rule({'char': '<Space>', 'at': '[ \+.*\%# \+]', 'leave': ' '})
This is on the fix-39 branch, commit 02efdbc140cb56f4d20362fa0f1c6522641c414a.
I could reproduce the problem thanks to your vimrc. I will try to fix it.
I found out the exact cause of the problem.
Your at
pattern in the last rule is treated as a collection pattern (e.g. [a-zA-Z]
)
Try escaping [
call lexima#add_rule({'char': '<Space>', 'at': '\[ \+.*\%# \+]', 'leave': ' '})
Hey, thanks for the troubleshooting. I must have missed the notification, sorry for ignoring you! I'll try this when I get back to my computer.
I tried to add the following rule:
This should allow me to continue typing after opening parentheses with an added space:
should now become
instead of the stock behavior:
This works fine... once. But if I have another set of parentheses with spaces anywhere in the file above the cursor, I cannot insert spaces in parentheses at all! Pressing spacebar in this file does nothing:
This is very weird. Does the regex match beyond the current line?