Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions vimtabdiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ def parse_args() -> argparse.Namespace:
parser.add_argument(
"--onlydiffs", help="only open files where there is a diff", action="store_true"
)
parser.add_argument(
"--skipmissing", help="skip non-existent files", action="store_true"
)
return parser.parse_args()


Expand Down Expand Up @@ -87,9 +90,10 @@ def main() -> None:
aPath = a.resolve() if a else os.devnull
bPath = b.resolve() if b else os.devnull
if (
args.onlydiffs
and a and b
and open(aPath, mode="rb").read() == open(bPath, mode="rb").read()
(args.skipmissing and (not a or not b)) or
(args.onlydiffs
and a and b
and open(aPath, mode="rb").read() == open(bPath, mode="rb").read())
):
continue
print(f"tabedit {aPath} | vsp {bPath}", file=vimCmdFile)
Expand Down