Commit graph

119 commits

Author SHA1 Message Date
Kovid Goyal
a3dfe2b55a
Make sticky_header default to yes 2026-04-19 12:14:39 +05:30
Petar Dobrev
7729e6e1ae kitten diff: add support for sticky header 2026-04-18 18:26:30 +03:00
Павел Мешалкин
8ffdf7d7ee feat: add per-mapping --allow-fallback for layout-independent shortcuts
Add --allow-fallback option to the map command that controls shifted
and ascii (alternate_key) fallback for individual key mappings.

For non-Latin keyboard layouts, when the current layout key is
non-ascii (codepoint > 127 and < 0xE000), the alternate_key from
the base layout is used for matching if the mapping opts in via
--allow-fallback=shifted,ascii.

Default kitty bindings use --allow-fallback=shifted,ascii so they
work out of the box with non-Latin layouts. User custom mappings
default to --allow-fallback=shifted (preserving existing shifted_key
behavior without ascii fallback).

--allow-fallback=none disables all fallback for a mapping.

Python side: parse_options_for_map() in options/utils.py handles flag
parsing, ShortcutMapping uses it in __init__. get_shortcut() filters
candidates by per-mapping allow_fallback.

Go side: ParseMap() handles --allow-fallback, KeyAction stores
AllowFallback, ShortcutTracker.Match passes it to matching.
MatchesParsedShortcut defaults to shifted,ascii for hardcoded shortcuts.

Migrated kittens (themes, command_palette, diff, choose_files) to
use ShortcutTracker with configurable map entries.

Tests added for Python (5 test methods) and Go (ParseMap + key matching).
2026-03-25 19:34:13 +03:00
Kovid Goyal
d8af7e2c88
Add an option to control highlighting of moved lines 2026-03-12 12:59:46 +05:30
copilot-swe-agent[bot]
f45345c7a7
Add colorMoved support to kitty diff kitten
Fixes #3241
Fixes #9644
2026-03-12 12:44:21 +05:30
Kovid Goyal
d15905c918
Change default word regexp to exclude punctuation 2026-03-04 09:20:53 +05:30
copilot-swe-agent[bot]
1785873835
diff kitten: Use a words based algorithm for intra line changed region highlighting
Fixes #9598
2026-03-04 09:06:37 +05:30
Kovid Goyal
a1927eb662
DRYer 2026-02-25 09:11:04 +05:30
Kovid Goyal
b26d0b6ac5
Add more text file types to kitten diff completion
Fixes #9556
2026-02-25 08:57:54 +05:30
Kovid Goyal
e42d410ee4
Move cli spec parsing code into simple module 2025-04-28 09:20:10 +05:30
bilbofroggins
fd14e103ef
Update main.py 2025-04-05 19:21:38 -04:00
Kovid Goyal
da1626090a
Update codebase to Python 3.10 using pyupgrade 2025-02-03 10:56:50 +05:30
Kovid Goyal
081c061538
Clarify prefix usage 2025-01-16 11:52:37 +05:30
Kovid Goyal
7a9e5d9dcb
... 2025-01-16 11:50:43 +05:30
Kovid Goyal
e34a899ea6
diff kitten: Automatically use dark/light color scheme based on the color scheme of the parent terminal
Fixes #8170
2025-01-04 12:57:33 +05:30
Jackie Li
bbe29dbc7b
[diff kitten] move next/prev file 2024-07-31 16:11:38 +01:00
Kovid Goyal
77292a16d6
Make shebangs consistent
Follow PEP 0394 and use /usr/bin/env python so that the python in the
users venv is respected. Not that the kitty python files are meant to be
executed standalone anyway, but, whatever.

Fixes #6810
2023-11-11 08:32:05 +05:30
Kovid Goyal
7169a89591
Add shortcuts for copying to clipboard 2023-03-29 19:56:08 +05:30
Kovid Goyal
d30091034a
Remove the python diff kitten 2023-03-27 11:46:22 +05:30
Kovid Goyal
44ff6bd1dd
Start work on porting diff kitten 2023-03-27 07:53:53 +05:30
Kovid Goyal
7fe5d7b58f
Replace isort with ruff 2023-01-09 16:47:42 +05:30
Kovid Goyal
a068e3e655
Fix issues reported by ruff 2023-01-09 15:54:41 +05:30
Kovid Goyal
1b5fac3189
Cleanup previous PR 2023-01-06 14:25:21 +05:30
TrellixVulnTeam
1223130ef7 Adding tarfile member sanitization to extractall() 2023-01-06 08:07:51 +00:00
pagedown
a131f9a82e
Refactor: Use a consistent name for beam cursor shape 2022-11-19 10:34:50 +08:00
Kovid Goyal
7737369fc9
Add completion for the kittens 2022-11-14 15:41:58 +05:30
pagedown
c3df6d2fe3
Remove executable perms from kitten files 2022-06-28 11:59:47 +08:00
Kovid Goyal
79f7954048
Cleanup previous PR 2022-06-06 17:19:52 +05:30
Suvayu Ali
20b6a97159 Update in response to feedback
- one configuration option: ignore_paths
- use shlex to parse option to support whitespace and in-line comments
- change option type to Tuple[str, ...]
- remove ignored directories from dirnames to prevent scanning
2022-06-06 11:00:45 +02:00
Suvayu Ali
fbf1ec43c7 diff kitten: add options to ignore paths when comparing directories
Tested locally & over SSH:

    $ kitty +kitten diff /local/path /local/path2
    $ kitty +kitten diff /local/path ssh:remote:/path
2022-06-05 00:11:30 +02:00
pagedown
510022c3c1
Docs: Improve the documentation for kittens
Add more text roles and links.
Add an example that broadcasts only to other windows in the current tab.
Initial capitalization of the key names in the kbd text role.
Add Python type hints for custom kittens.
Note about hyperlink support for ls on macOS.
Add description text for show_key.
2022-04-27 16:14:54 +08:00
pagedown
8e03da855f
diff kitten: Fix wrong number of scrolling lines after context switch 2022-03-14 20:29:15 +08:00
pagedown
4a3ed62809
Refactor: More f-string for kittens 2022-01-29 20:23:34 +08:00
Kovid Goyal
f9a4b6bb0d
Use an enum for state as well 2022-01-18 13:58:55 +05:30
Kovid Goyal
f1fbfe297d
Use an enum for background work 2022-01-18 13:50:05 +05:30
Kovid Goyal
2c0ac895e6
diff kitten: Fix exiting while highlighting is incomplete causes kitten to hang until highlighting is done 2022-01-18 13:43:39 +05:30
Kovid Goyal
6546c1da9b
run pyupgrade to upgrade the codebase to python3.6 2021-10-21 12:43:55 +05:30
Kovid Goyal
6d7df1c5e8
Refactor configuration file parsing
Now the time for importing the kitty.config module has been halved, from
16ms from 32ms on my machine. Also, the new architecture will eventually
allow for auto generating a bunch of python-to-C boilerplate code.
2021-05-31 17:40:49 +05:30
Kovid Goyal
42a7023203
Fix #3332 2021-02-21 13:18:48 +05:30
Kovid Goyal
df89266c03
diff kitten: Implement recursive diff over SSH
Fixes #3268
2021-01-28 14:23:56 +05:30
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
Kovid Goyal
f52c843fa2
Add support for placement id to GraphicsCommand 2020-12-02 05:35:57 +05:30
Kovid Goyal
efca2658ea
Fix typing issues pointed out by updated mypy 2020-10-12 23:03:07 +05:30
Kovid Goyal
0e2ff077af
Fix #2682 2020-05-23 09:03:44 +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
2ebdf738ca
more typing work 2020-03-11 20:08:16 +05:30
Kovid Goyal
afec07b124
More typing work 2020-03-06 14:19:46 +05:30