Re: [PATCH] vimdiff: fix 'vimdiff3' behavior (colors + no extra key press)
- From
Felipe Contreras <felipe.contreras@gmail.com>
- Date
- Aug 7, 2022, 00:55 UTC
- Message-ID
- <CAMP44s0QjKzt7VNFPWAi9RKThP2H2VP=4hYiDP4X9-CzrmYrew@mail.gmail.com>
- In-Reply-To
- <20220806213005.92045-1-greenfoo@u92.eu>
On Sat, Aug 6, 2022 at 4:30 PM Fernando Ramos <greenfoo@u92.eu> wrote:
Show 11 quoted lines
>
> + # Add an extra "-c" option to move to the first tab (notice that we
> + # can't simply append the command to the previous "-c" string as
> + # explained here: https://github.com/vim/vim/issues/9076
>
> - # Add an extra "-c" option to move to the first tab (notice that we
> - # can't simply append the command to the previous "-c" string as
> - # explained here: https://github.com/vim/vim/issues/9076
> + FINAL_CMD="-c \"$CMD\" -c \"tabfirst\""
> + else
> + CMD="$CMD | set hidden | let tmp=bufnr('%') | silent bufdo diffthis | exe 'buffer '.tmp"NAK: This runs `exe 'buffer #'` in every buffer. While switching to the desired buffer 3 extra times isn't a problem, it's also not correct.
You need something like:
silent exe 'bufdo diffthis' | exe 'buffer '.tmp"
But at this point it seems like we are working around the current organization of the code, when we could simply reorganize it.
Cheers.
-- Felipe Contreras