Commit graph

189 commits

Author SHA1 Message Date
Kovid Goyal
9c6ba213f9
Fix key handling in diff kitten 2021-01-16 20:52:14 +05:30
Kovid Goyal
027c5a57f1
Work on porting kittens to use new key infrastructure
Also move type definitions into their own module
2021-01-16 20:52:14 +05:30
Tomas Krizek
dbe44c9e4b
kitten/diff: allow specifying none color for select_fg
Allow diff kitten to not override foreground color for selections.

Related #1358
2021-01-01 23:25:06 +01:00
Kovid Goyal
f52c843fa2
Add support for placement id to GraphicsCommand 2020-12-02 05:35:57 +05:30
Kovid Goyal
75a94bcd96
Improving MIME type detection for some common file types when they are missing from the system MIME database
Also allow the user to specify their own database via mime.types in the
kitty config directory. See #3056
2020-10-25 13:42:11 +05:30
Kovid Goyal
efca2658ea
Fix typing issues pointed out by updated mypy 2020-10-12 23:03:07 +05:30
Kovid Goyal
2c6e5a6e73
Get multiprocessing working in kitty
Monkeypatch the stdlib multiprocessing module to
use kitty as its python interpreter for spawning worker
processes.
2020-06-21 14:47:24 +05:30
Kovid Goyal
e07916425e
macOS: Fix for diff kitten not working with python 3.8
Fixes #2780
2020-06-20 19:03:45 +05:30
Kovid Goyal
0e2ff077af
Fix #2682 2020-05-23 09:03:44 +05:30
Kovid Goyal
4e7bf80447
diff kitten: New option to control the background color for filler lines in the margin
Fixes #2518
2020-04-08 20:42:49 +05:30
Kovid Goyal
8f1c6c4d74
Fix #2482 2020-03-26 00:53:19 +05:30
Kovid Goyal
eddd45bbc3
diff kitten: Fix images losing position when scrolling using mouse wheel/touchpad 2020-03-19 18:46:10 +05:30
Kovid Goyal
c912eef040
Minor strictness increases 2020-03-14 14:59:31 +05:30
Kovid Goyal
149ae2866a
more typing work 2020-03-12 08:10:51 +05:30
Kovid Goyal
2ebdf738ca
more typing work 2020-03-11 20:08:16 +05:30
Kovid Goyal
8ae110691e
More typing work 2020-03-09 21:06:13 +05:30
Kovid Goyal
afec07b124
More typing work 2020-03-06 14:19:46 +05:30
Kovid Goyal
f05890719d
Add type checking for the various CLI options objects 2020-03-05 15:47:12 +05:30
Kovid Goyal
ec8c96b8e6
diff kitten: Highlight pyi files as python 2020-03-04 11:52:58 +05:30
Kovid Goyal
36eb52424f
No top level typing issues for kittens 2020-03-04 07:49:28 +05:30
Kovid Goyal
5730ce5f53
More typing work 2020-03-03 20:18:24 +05:30
Kovid Goyal
27524bfc3d
Restore global key definitions so as not to break third party kittens that might use them 2020-03-03 15:06:10 +05:30
Kovid Goyal
8843ded1c9
Refactor key encoding
Cannot have key names in global namespace as not all key names are valid
python identifiers. So move them into a dict.
2020-03-03 14:54:30 +05:30
Kovid Goyal
d6d01102fe
diff kitten: Fix directory diffing with removed binary files failing
Fixes #2378
2020-02-19 19:53:19 +05:30
Kovid Goyal
802da7087c
diff kitten: Allow diffing remote files easily via ssh
See #727
2019-10-04 09:08:22 +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
Luflosi
3b34cec64c
Consistent case for color codes 2019-02-25 14:47:14 +01:00
Kovid Goyal
6b6dea5190
... 2019-01-19 13:51:18 +05:30
Kovid Goyal
5af551c96d
macOS: Fix detection of differ
There can be a wrapper git on macOS that complains about command line
tools installation, so check that passing --help to it actually works.
2019-01-19 12:36:34 +05:30
Kovid Goyal
3bddb9d95b
Fix an exception when chaging diff context on very small diffs 2019-01-16 21:24:34 +05:30
Kovid Goyal
3bd45966c6
diff kitten: Fix spurious traceback on exit when pygments is missing
Fixes #863
2018-09-06 06:05:08 +05:30
Kovid Goyal
e05d48a574
Also prevent long running diff workers from causing a hang on exit 2018-08-04 17:51:33 +05:30
Kovid Goyal
927bfcd37a
Use only a single diff executor 2018-08-04 17:46:05 +05:30
Kovid Goyal
42cabace47
Better fix for long running highlight workers 2018-08-04 17:41:37 +05:30
Kovid Goyal
9a1f14d05c
diff kitten: Do not highlight extremely large files
python's asyncio module has no way to tell a process executor object to
kill its worker processes, so highlighting very large files cause the
kitten to hang around o exit till the highlighting is done
2018-08-04 17:30:45 +05:30
Kovid Goyal
f018e1a075
Nicer check for is_binary 2018-07-28 14:02:01 +05:30
Kovid Goyal
8a812c9d02
diff kitten: Fix error when only RHS file is a binary file
Fixes #752
2018-07-28 13:59:32 +05:30
Kovid Goyal
feb97b2313
Use asyncio for jobs in the diff kitten 2018-07-15 16:09:52 +05:30
Kovid Goyal
491f233d33
diff kitten: When triggering a search scroll to the first match automatically 2018-06-19 10:30:52 +05:30
Kovid Goyal
fedde51c12
... 2018-06-16 10:16:06 +05:30
Kovid Goyal
ad97315925
diff kitten: Misc fixes to msg display in the status line 2018-06-16 08:57:02 +05:30
Kovid Goyal
3669d4135c
diff kitten: Add keybindings to search without regex 2018-06-16 08:45:42 +05:30
Kovid Goyal
8b4fe494cf
Format matches count the same as scroll percent 2018-06-16 08:24:32 +05:30
Kovid Goyal
84b99b1b3d
diff kitten: Clear the search when pressing Esc 2018-06-15 15:00:09 +05:30
Kovid Goyal
1022d8a0ee
diff kitten: Show the number of matches in the status bar when doing a search 2018-06-15 14:57:03 +05:30
Kovid Goyal
59743fd7a1
diff kitten: Allow theming the selection background/foreground as well 2018-06-15 14:43:39 +05:30
Kovid Goyal
fe3b10a8fb
diff kitten: Implement searching for text in the diff
Fixes #574
2018-06-15 14:28:42 +05:30
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
2a8295d71c
diff kitten: Better error message when one of the arguments does not exist 2018-06-14 21:53:13 +05:30
Kovid Goyal
8a1a45b067
Allow the diff kitten to work even if stdout/stdin are redirected
Now directly opens /dev/tty
2018-06-06 12:01:47 +05:30
Kovid Goyal
97c317b735
Make screen_size handling in tui cleaner
Now screen size is fetched only for output_fd rather than sys.stdout
2018-06-06 11:20:55 +05:30
Kovid Goyal
d39cf5d702
Get rid of the default diff.conf 2018-06-05 10:44:18 +05:30
Kovid Goyal
7cf6b8b594
Move the config utils into its own package 2018-06-03 11:54:26 +05:30
Kovid Goyal
bb8e0e7789
Add CLI docs for the diff kitten 2018-06-02 13:09:18 +05:30
Kovid Goyal
28803d9a5a
Use rst roles to format cli help text 2018-05-30 19:07:12 +05:30
Kovid Goyal
f6d0cadcc5
Redirect old asciidoc pages to new website 2018-05-30 12:52:59 +05:30
Kovid Goyal
94f1759b14
Update README 2018-05-24 19:31:08 +05:30
Kovid Goyal
a33ebce3c9
diff kitten: Add keybindings to scroll by a page 2018-05-24 15:17:03 +05:30
Kovid Goyal
219d3161d9
diff kitten: Fix incorrect syntax highlighting with a few file formats such as yaml 2018-05-24 15:00:26 +05:30
Kovid Goyal
2a5ef628fa
DRYer 2018-05-23 13:25:46 +05:30
Kovid Goyal
4b259dd719
diff kitten: Make the keyboard shortcuts configurable
Fixes #563
2018-05-23 13:10:32 +05:30
Kovid Goyal
3d37348c2b
... 2018-05-21 23:17:44 +05:30
Kovid Goyal
e70b5114fb
diff kitten: resolve symlinks before passing paths to the diff tool 2018-05-21 15:50:28 +05:30
Kovid Goyal
be28e7bf46
Update README 2018-05-21 11:30:19 +05:30
Kovid Goyal
6b2b8e0208
... 2018-05-21 11:00:24 +05:30
Kovid Goyal
c997dc8ea7
Add a link to the default diff.conf 2018-05-21 10:59:10 +05:30
Kovid Goyal
a20e7e2a6b
Add a note about why kitty-diff is kitty only 2018-05-21 10:51:50 +05:30
Kovid Goyal
624dfdf913
Update README 2018-05-20 17:33:09 +05:30
Kovid Goyal
b6baa99fce
diff kitten: Make the representation of tabs configurable 2018-05-20 15:37:52 +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
b1b90d2bf7
Replace tabs in README 2018-05-20 15:17:19 +05:30
Kovid Goyal
37bd964fee
Add some notes about integrating with git 2018-05-20 15:12:21 +05:30
Kovid Goyal
fa3e173c18
diff kitten: Report errors converting images 2018-05-20 15:01:25 +05:30
Kovid Goyal
2a9dc23c61
... 2018-05-20 12:44:16 +05:30
Kovid Goyal
2885f54360
Add README for diff kitten 2018-05-20 12:41:40 +05:30
Kovid Goyal
ac2f4c8ab6
Nicer window title for the diff kitten 2018-05-20 12:26:14 +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
029b82807c
Ignore \ prefixed lines when parsing patches 2018-05-19 23:02:49 +05:30
Kovid Goyal
67c0942e01
Fix error reporting in the diff kitten 2018-05-19 22:51:02 +05:30
Kovid Goyal
6020aadbf2
diff kitten: Show overall diff stats 2018-05-18 14:19:25 +05:30
Kovid Goyal
f8b6b532e0
diff kitten: Show scroll % 2018-05-18 13:36:12 +05:30
Kovid Goyal
91a1d61cc6
diff: Fix margins not being reset on exit 2018-05-10 16:21:26 +05:30
Kovid Goyal
ed511c296c
Avoid needing to resend images on every draw_screen() 2018-05-10 15:58:52 +05:30
Kovid Goyal
eab1fbbbb0
diff: Mark displayed images as change starts 2018-05-10 15:29:53 +05:30
Kovid Goyal
ee3b052a50
tui: Preserve cursor position when placing images 2018-05-10 15:27:35 +05:30
Kovid Goyal
51d76e5a2b
... 2018-05-10 14:37:43 +05:30
Kovid Goyal
a6bce0b221
diff: More work on showing images 2018-05-10 14:33:09 +05:30
Kovid Goyal
fb5dc8a2ba
A spot of refactoring 2018-05-10 11:52:51 +05:30
Kovid Goyal
5d7ed67316
diff: More work on displaying images 2018-05-10 10:36:50 +05:30
Kovid Goyal
6d038f5cdf
Pass the image manager to the render code 2018-05-09 20:12:39 +05:30
Kovid Goyal
2e69b904da
diff: More work on images 2018-05-09 14:06:15 +05:30
Kovid Goyal
d51a424b98
diff: Start work on image display 2018-05-09 10:25:53 +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
b663160bc2
Fix rendering of binary files 2018-05-09 08:17:52 +05:30
Kovid Goyal
a65c807a4a
diff: Add keyboard shortcuts to got to next/previous change 2018-05-09 08:12:40 +05:30
Kovid Goyal
3a1f85cb69
diff: Make the diff implementation configurable 2018-05-08 23:32:21 +05:30
Kovid Goyal
196bd9c22b
Allow setting the number of context lines in diff.conf 2018-05-08 23:17:40 +05:30