Moved from plugin to ftplugin#79
Moved from plugin to ftplugin#79dhruvasagar wants to merge 5 commits intoastashov:masterfrom dhruvasagar:master
Conversation
Rdebugger specific mappings & commands make sense to be available only in ruby files, so switched to a ftplugin instead and defined the mappings & commands to be buffer localized so as to be available only for those buffers and not for others for which it was not intended.
|
Hi! Thanks for the pull request, but as for me, since it makes sense from the first view, you don't always want to start :Rdebugger from only the Ruby files. E.g. I'm working on Rails project, and I've got Javascript or YAML file opened, and I need to restart the server - I'm trying to do that, but it says - no such command, so I have to switch to some Ruby file first to actually restart the server. What problem it actually solves? Why we don't want to have :Rdebugger command available in any file type? |
|
Hey, I will work further on this and support rails applications as well, I will allow it to be used under a rails app :), i'll refer to rails.vim for the same. As far as the reason for this, well the primary motivation I had for this is that this stalls vim for a bit when used without the right context be set. Or if I run it accidentally somewhere I didn't intend to. Since this is meant to debug ruby to me, it made more sense to be available only for ruby projects, I did miss out for rails, so will work on that now. The other thing (off topic), that I was thinking is what do you think about a rewrite of this plugin, but predominantly in ruby ? Since it is for debugging ruby, I think we will be able to write it better in ruby itself, surely dependence on ruby support is not an issue since after all we are debugging ruby. |
That's actually weird, do you know the reason? It shouldn't even do anything until you explicitly run it by :Rdebugger.
Why to do that? That is a lot of work, not sure what would be the win here. :) |
The most common use case : I tend to launch gvim from gnome-do, an app launcher. I use nerdtree to switch to a bookmarked project directory, or I use vim-sessions and gvim then loads the project automatically remember last opened files when I was working on the same. And I launch ruby - debugger, and it will fail and stall (hang) vim for a couple or so seconds, since the ruby is not set at all, because of rvm. I have to switch / define the right ruby to be used with the help of rvm, for which I use vim-rvm plugin. Only after that is done, rdebugger works fine.
Here are my thoughts :
Who knows, maybe we could even debug ruby-debugger using itself ;). |
This reverts commit 2ce60e8.
Rdebugger specific mappings & commands make sense to be available only
in ruby files, so switched to a ftplugin instead and defined the
mappings & commands to be buffer localized so as to be available only
for those buffers and not for others for which it was not intended.