Hi.
Recently i updated vim from patch 444 to 515 as official Fedora package
update. After that i found that autoindent for {} is brogen. After some
research i found that it got broken in patch 461
6734 7.3.461 InsertCharPre event not always triggered
This patch, as it says, was introduced for better dealing with
InsertCharPre (by the way there is no link to this in :help database!) and
i made a search inside my plugins. I found the command that breaks the
autoindent in plugin RegImap, here it is:
autocmd InsertCharPre * let s:useTrigger = 1
Very simple, but it breaks autoindent!
Here is a patch that fixes the problem for me (against latest vim patch
531):
diff -r 1c6b099ead89 src/edit.c
--- a/src/edit.c Sun May 27 00:37:51 2012 +0200
+++ b/src/edit.c Sun May 27 22:33:17 2012 +0400
@@ -1428,6 +1428,8 @@
AppendToRedobuffLit(str, -1);
}
vim_free(str);
+ if (can_cindent && in_cinkeys(c, ' ', TRUE))
+ do_c_expr_indent();
c = NUL;
}
Probably it can be made better: i did not completely understand details of
in_cinkeys() and stop_arrow() (which is missed here but present in similar
checks in other lines).
I also included this in attachment.
Cheers, Alexey.
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
InsertCharPre_autoindent.patch
Description: Binary data
