LucHermitte/alternate-lite

Alternate to new file

fwsmit opened this issue · 5 comments

This may be a problem with the underlying library and not this specific plugin. This problem can be worked around. I'll mention it anyway, because I use this plugin so often.
When using alternate-lite from foo.h and the file foo.cpp doesn't exist yet, Alternate will ask which file extension you want to use. The problem is that I don't know how you are supposed to choose an option.
Pressing enter only cancels the dialog and pressing the key in brackets will only get me the first option.
I tried to have just one option for a file extension, but that doesn't seem to work either. I placed this in my .vimrc:
call lh#alternate#register_extension('g', 'cpp', ['h'], 1) call lh#alternate#register_extension('g', 'h', ['cpp'], 1)
Also, pressing escape doesn't cancel the dialog.

It looks like the problem lies with confirm() default behaviour in plain vim (I always use gvim and hardly notice such problems).

I've pushed an evolution into lh-vim-lib. If you set g:ui_type to 'text_nodefault' from your .vimrc (when you're not running gvim), you should be able to select the name of the file (EDIT), with tab or with cursor keys.

(Along the way, it fixes an issue I had with local_vimrc when running plain vim). I hesitate to make this the default behaviour...

Regarding the workaround you were looking for, it looks like register_extensions() isn't doing what it's supposed to do.

I'll have to investigate why I added a test to prevent the options from being overridden. It looks like a bug.

I've improved lh#ui#confirm() behaviour. You won't need to set anything, the default should work fine now.

Great work, Luc. I love your plugins. Do you need any help with testing or some easy coding on one of your plugins? I would love to help!

Thanks :)
Any help is welcomed. Bug reports are already a good start.
Contributions are also welcomed, alas I still need to provide a contributing guide regarding copyright, coding style, and stuff.

At this time I have no particular plan. Lately I've implemented important modifications in lh-dev in order to reduce dependencies, and as such a lot of testing should be done. In particular lh-style is poorly tested, and still incomplete.
Also, the project branch from build-tool-wrappers needs more testing. Some refactoring could be done to have it support something equivalent to :Asynrun when one doesn't want to define full projects and so on.
Also, if you see any todo in my code that'll like to see implemented, don't hesitate to open an issue or to look into it.