Why don't :diffget and :diffput allow completion after hitting <Tab> or <C-D>?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Why don't :diffget and :diffput allow completion after hitting <Tab> or <C-D>?

jairlopez
Hello Vim community,

This is what the documentation in :help E787 says:

> The [bufspec] argument above can be a buffer number, a pattern for a buffer
> name or a part of a buffer name.  Examples:
>
> :diffget Use the other buffer which is in diff mode
> :diffget 3 Use buffer 3
> :diffget v2 Use the buffer which matches "v2" and is in
> diff mode (e.g., "file.c.v2")


It would be nice if it can allow completion like the :buffer command currently
does; specially when dealing with merge conflicts as described here:
https://stackoverflow.com/questions/14904644/how-do-i-use-vimdiff-to-resolve-a-git-merge-conflict

Maybe I'm missing something, so I wonder why <Tab> and <C-D> doesn't work in
:diffget and :diffput.

Thanks in advanced.


--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20191228123913.Horde.U363qe930xTtyjI2DnhOyek%40tommy.heliohost.org.
Reply | Threaded
Open this post in threaded view
|

Re: Why don't :diffget and :diffput allow completion after hitting <Tab> or <C-D>?

Dominique Pellé
[hidden email] wrote:

> Hello Vim community,
>
> This is what the documentation in :help E787 says:
>
> > The [bufspec] argument above can be a buffer number, a pattern for a buffer
> > name or a part of a buffer name.  Examples:
> >
> >       :diffget                Use the other buffer which is in diff mode
> >       :diffget 3              Use buffer 3
> >       :diffget v2             Use the buffer which matches "v2" and is in
> >                               diff mode (e.g., "file.c.v2")
>
>
> It would be nice if it can allow completion like the :buffer command currently
> does; specially when dealing with merge conflicts as described here:
> https://stackoverflow.com/questions/14904644/how-do-i-use-vimdiff-to-resolve-a-git-merge-conflict
>
> Maybe I'm missing something, so I wonder why <Tab> and <C-D> doesn't work in
> :diffget and :diffput.

Completion could indeed be improved for diffput & diffget.
But ideally, it should not be like :buffer, as :diffput :diffget
should only complete to buffer which are in diffmode and
also not complete the buffer name from which the diffput
or diffget originates.

Regards
Dominique

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAON-T_jxXWoT%2BhS8wiYa6-rc8wSecHT2895gxcaqLzS4g-ffdA%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Why don't :diffget and :diffput allow completion after hitting <Tab> or <C-D>?

jairlopez
Thanks Dominique for your answer :-)

> Completion could indeed be improved for diffput & diffget.
Did you mean something like creating custom commands, like :Diffget  
and :Diffput, that behave in that way?

> But ideally, it should not be like :buffer, as :diffput :diffget
> should only complete to buffer which are in diffmode and
> also not complete the buffer name from which the diffput
> or diffget originates.


--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20191228133542.Horde.rWrrt1AJgY-O-e6hCk-Vj02%40tommy.heliohost.org.
Reply | Threaded
Open this post in threaded view
|

Re: Why don't :diffget and :diffput allow completion after hitting <Tab> or <C-D>?

jairlopez
In reply to this post by Dominique Pellé
  Thanks Dominique for your answer :-)

> Completion could indeed be improved for diffput & diffget.

Did you mean something like creating custom commands, like :Diffget  
and :Diffput, that behave in that way?

> But ideally, it should not be like :buffer, as :diffput :diffget
> should only complete to buffer which are in diffmode and
> also not complete the buffer name from which the diffput
> or diffget originates.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20191228143211.Horde.2elTt2_GbX3QN-CDMzVMY99%40tommy.heliohost.org.
Reply | Threaded
Open this post in threaded view
|

Re: Why don't :diffget and :diffput allow completion after hitting <Tab> or <C-D>?

Dominique Pellé
In reply to this post by jairlopez
[hidden email] wrote:

> Thanks Dominique for your answer :-)
>
> > Completion could indeed be improved for diffput & diffget.
>
> Did you mean something like creating custom commands, like :Diffget
> and :Diffput, that behave in that way?

No. I meant we could add completion to the Vim :diffget
and :diffput commands.  I just created a pull request
with this new feature:

https://github.com/vim/vim/pull/5409

Can you try it and provide feedback?

With this proposed change, `:diffget` and `:diffput`
complete to file names which are diff mode and which
are different than the current buffer.  No completion
when current buffer is not in diff mode. No completion
either in vim tiny/small where FEAT_DIFF is not enabled.

Regards
Dominique

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAON-T_jerSmsyqwfO3_J7ejrLGaWzhaEQ-svyTOXo%2BzeXPT93g%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Why don't :diffget and :diffput allow completion after hitting <Tab> or <C-D>?

jairlopez
> I just created a pull request
> with this new feature:

Cool! I think it's already "merged". Thank you Dominique for your pull  
request!
I'll test it when I have a chance.

Happy holidays!


--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20191229150939.Horde.hSTS_pWBGfvP8KT5DfWjmBE%40tommy.heliohost.org.