From 32e186695ad168b167a9342b31babbec8d353b04 Mon Sep 17 00:00:00 2001 From: Balakrishnan Balasubramanian Date: Mon, 6 Mar 2023 10:53:14 -0500 Subject: [PATCH] Keep new changes on right Saves and restores splitright option Backported from 512df2948 --- vimtabdiff.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/vimtabdiff.py b/vimtabdiff.py index 0b092ab..747798f 100755 --- a/vimtabdiff.py +++ b/vimtabdiff.py @@ -67,6 +67,11 @@ def main(): args = parse_args() vimCmdFile = tempfile.NamedTemporaryFile(mode='w', delete=False) with vimCmdFile: + cmds = f""" + let s:spr = &splitright + set splitright + """ + print(cmds, file=vimCmdFile) for a, b in get_file_pairs(args.pathA, args.pathB): aPath = a.resolve() if a else os.devnull bPath = b.resolve() if b else os.devnull @@ -74,6 +79,10 @@ def main(): f"tabedit {aPath} | diffthis | vsp {bPath} | diffthis | diffupdate", file=vimCmdFile) cmds = f""" + let &splitright = s:spr + tabdo windo :1 + tabdo windo diffthis + tabdo windo diffupdate tabfirst | tabclose call delete("{vimCmdFile.name}") """