Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
[RFC] Add vimexpect library and example gdb plugin #2314
I think Neovim still needs one extra feature before a debugger plugin can be polished enough for general use: mappings local to window and/or tabpage(That way the debugger shortcuts can be activated only in the "debugging view").
Plus this one is more a proof of concept, and the name is a bit misleading: It's not a generic gdb plugin for Neovim, but a gdb plugin specifically created for developing Neovim. Take
Apr 2, 2015
1 check passed
added a commit
this pull request
Apr 2, 2015
So the idea is that "debug mode" would be enabled in one tab, but not globally. I don't see why global mappings for debug mode would be a problem though (which are removed after debug mode is done). Maybe what we really need is a way for global (and buffer-local) mappings to temporarily mask global/buffer mappings and then restore the original mappings reliably after the mode is exited.
If I load a buffer into such a tabpage, what happens with the buffer's FileType/ftplugin which sets up buffer-local mappings? This is a lot of cognitive overheard for the user.
Why do you think something should happen? Vim lived with two tables with mappings for years, adding third table should not make any difference. If code was sane enough to just iterate over tables in place of doing “loop unroll” manually that would even be trivial to implement.
I do not think there is much additional overhead to what is already there because of buffer-local mappings. I do not see much difference between “filetype is X” condition and “tabpage is Y” (as long as they are indicated properly).
While this is possible, it makes things more complicated and error-prone for plugins which will repeat code for saving/restoring mappings. Not to mention it won't handle more complicated scenarios like this one:
With tab-local mappings this is greatly simplified because everything is handled by the mapping engine automatically.
Its another way to handle the problem, but still more complicated than tab-local mappings that have a predefined scope.
First search buffer, then tab, then global mappings.