From 512df2948e0008e9e1c6219ec3b1219377838a34 Mon Sep 17 00:00:00 2001 From: Balakrishnan Balasubramanian Date: Wed, 1 Mar 2023 00:05:35 -0500 Subject: [PATCH] Keep new changes on right Saves and restores splitright option --- vimtabdiff.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vimtabdiff.py b/vimtabdiff.py index 0db3849..02550fc 100755 --- a/vimtabdiff.py +++ b/vimtabdiff.py @@ -78,6 +78,11 @@ def main() -> None: 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 @@ -89,6 +94,7 @@ def main() -> None: continue print(f"tabedit {aPath} | vsp {bPath}", file=vimCmdFile) cmds = f""" + let &splitright = s:spr tabdo windo :1 tabdo windo diffthis tabdo windo diffupdate