On Wednesday, August 8, 2018 at 10:01:32 AM UTC+2, Bram Moolenaar wrote: > Jason Felice wrote: > > > I'd like for my plugin (which ensures parentheses are balanced) to merge > > the setline() change with the insertion. As far as I can tell, there's no > > way to do that with this fix. (undojoin does not work in insert mode) > > > > In addition to this allowing the user to unbalance the parentheses by using > > undo, undoing triggers TextChangedI (which is good) and I reapply the same > > parenthesis-balancing fix made the first time, getting the user stuck and > > unable to undo. > > > > Thoughts? Work-around or different approach? Should, in theory at least, > > undojoin work in insert mode? > > You mean that setline() now starts a new undoable change? Yeah, I've > been wondering if that is a problem. Unfortunately it won't be easy to > make this work, since edit() keeps its undo information locally, and > other places making changes would need to access that to know what to > do. > > -- > TIM: But follow only if you are men of valour. For the entrance to this cave > is guarded by a monster, a creature so foul and cruel that no man yet has > fought with it and lived. Bones of full fifty men lie strewn about its > lair ... > "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD > > /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ > /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ > \\\ an exciting new programming language -- http://www.Zimbu.org /// > \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
How about setting the ins_need_undo variable like it's done in https://github.com/vim/vim/pull/3297 but for the TextChangedI event? -- -- 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 --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
