From: Felipe Contreras Date: Sun, 07 Aug 2022 00:55:07 GMT Subject: Re: [PATCH] vimdiff: fix 'vimdiff3' behavior (colors + no extra key press) Message-ID: In-Reply-To: <20220806213005.92045-1-greenfoo@u92.eu> On Sat, Aug 6, 2022 at 4:30 PM Fernando Ramos wrote: > > + # 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