19 Commits

Author SHA1 Message Date
Kovid Goyal
d6d01102fe
diff kitten: Fix directory diffing with removed binary files failing
Fixes #2378
2020-02-19 19:53:19 +05:30
Luflosi
2b095f720e
Use "with suppress()" to suppress python exceptions
Using
```Python
with suppress(OSError):
    os.remove('somefile.tmp')
```
instead of
```Python
try:
    os.remove('somefile.tmp')
except OSError:
    pass
```
makes the code more compact and more readable IMO.

This pattern was recommended by Raymond Hettinger, a Python Core
Developer in his talk "Transforming Code into Beautiful, Idiomatic Python" at https://www.youtube.com/watch?v=OSGv2VnC0go. The transcript is available at https://github.com/JeffPaine/beautiful_idiomatic_python
2019-06-03 12:27:43 +02:00
Luflosi
a792c94ccf
Use python3 shebang for all python scripts
Fixes #1624.
Use python3 shebang for all python scripts as python still defaults to python2 on many systems.
2019-05-20 14:44:24 +02:00
Kovid Goyal
22cffef7c8
diff kitten: Use a single-width replacement for control chars
Preserves text width better, and conveys the essential message, namely
non-printable characters. Most people wont know what <hex code> is in
any case.
2018-06-15 08:08:21 +05:30
Kovid Goyal
5dfb8b1d80
diff kitten: Display CRLF line endings using the unicode return symbol instead of <d> as it is less intrusive.
Fixes #638
2018-06-15 07:08:57 +05:30
Kovid Goyal
912b395316
diff kitten: Render tabs as four spaces instead of <9> 2018-05-20 15:29:12 +05:30
Kovid Goyal
fa3e173c18
diff kitten: Report errors converting images 2018-05-20 15:01:25 +05:30
Kovid Goyal
9cab8a2de5
diff kitten: Do not specify the default foreground color in formatting codes.
Fixes an issue with foreground color being incorrect after a highlighted
segment if the syntax highlight does not specify a foreground color at
the boundary.
2018-05-20 08:51:41 +05:30
Kovid Goyal
6020aadbf2
diff kitten: Show overall diff stats 2018-05-18 14:19:25 +05:30
Kovid Goyal
b9fa8dbe42
DRYer 2018-05-09 09:28:38 +05:30
Kovid Goyal
3820c46801
Ensure there is a blank line before each new item 2018-05-09 08:33:24 +05:30
Kovid Goyal
7365ed9b05
diff: Better title rendering 2018-05-08 23:02:00 +05:30
Kovid Goyal
96793a296c
diff kitten has working syntax highlighting 2018-05-08 14:48:01 +05:30
Kovid Goyal
09a3a3dafb
More work on the diff kitten 2018-05-08 08:43:41 +05:30
Kovid Goyal
67379c67cc
More work on the diff kitten 2018-05-05 13:38:28 +05:30
Kovid Goyal
f5c713b118
More work on the diff kitten 2018-05-05 09:45:35 +05:30
Kovid Goyal
d54b58d2f3
... 2018-04-25 19:50:40 +05:30
Kovid Goyal
6929358976
More work on the diff kitten 2018-04-21 15:45:16 +05:30
Kovid Goyal
0a8dc4be0a
Start work on the diff kitten 2018-04-17 17:43:56 +05:30