BRainynight / TwoColumnsTextViewer

A terminal-based UI to show the difference between two file.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Description

A simple text viewer for viewing differences between 2 files.

Requirement

  • Python 3.8

Usage

  • Use keyboard or vim-style arrow keys to control cursor up and down.
  • Refresh comparison by key r
python main.py <fromfile> <tofile>	 	# compare 2 file based on fromfile 
python main.py -r <fromfile> <tofile>	# compare 2 file based on tofile.

Screenshot

Example

Update Logs

  • 2022/11/10:
    • Handle keyboard interrupt exception and resize event.
    • Keep tab spacing in viewer.
    • Press r can refresh comparison.
  • 2022/11/03:
    • Enable vim-style arrow keys (k, j, h, l). For my VS code terminal (PowerShell) , the keyboard arrow keys is unable because its return value of getkey() is differ from the official key list.
    • Add file name in the top of viewer.
    • Add the line number range for each block.
    • Add the argument reverse in CLI.

Reference

About

A terminal-based UI to show the difference between two file.


Languages

Language:Python 100.0%