Commit graph

191 commits

Author SHA1 Message Date
Kovid Goyal
5de8734ce3
choose-files kitten: Output a trailing newline when writing to a tty in text format
Fixes #9982
2026-05-07 08:53:09 +05:30
Павел Мешалкин
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
eddaaed3e3
Modernize Go code 2026-03-21 08:41:47 +05:30
copilot-swe-agent[bot]
3862ae26cc
Fix fuzzy match highlighting in choose_files kitten
Fixes #9693
2026-03-17 14:28:56 +05:30
Kovid Goyal
3db06a2915
More debug prints 2026-02-22 16:44:57 +05:30
Kovid Goyal
a5433b8994
kitten choose-files: Add a new binding of Alt+Enter to modify the name of an existing file when choosing a save file name
Fixes #9387
2026-01-26 11:50:08 +05:30
Kovid Goyal
ada88e063b
choose-files: Fix TAB completion in file prompt not respecting current cwd 2026-01-26 11:50:08 +05:30
Kovid Goyal
c815e580ea
Fix warning when generating docs 2025-12-05 20:11:23 +05:30
Kovid Goyal
97d8c2a230
... 2025-12-05 19:56:55 +05:30
Kovid Goyal
772805b8ec
choose files: Add arbitrary command based previews
Needs testing. Someday.
2025-12-05 19:54:21 +05:30
Kovid Goyal
7075f71da4
Cleanup highlighting of positions in text and add some tests 2025-12-05 09:40:36 +05:30
Kovid Goyal
4e2aa7d151
Explicitly remove audio/subtitle and data streams when generating previews via ffmpeg 2025-12-02 18:51:33 +05:30
Kovid Goyal
5f90102413
Add support for RAR archive preview 2025-11-27 09:33:15 +05:30
Kovid Goyal
438114d880
DRYer 2025-11-26 21:22:47 +05:30
Kovid Goyal
222bf3cb0b
Handle multiple results when invoked from mapping 2025-11-26 21:19:30 +05:30
Kovid Goyal
8c17b1bc2f
... 2025-11-26 21:16:48 +05:30
Kovid Goyal
f8db2702db
choose files: Add a few more output formats 2025-11-26 21:13:57 +05:30
Kovid Goyal
22f0292e35
Choose files: Preview for common archive types 2025-11-24 21:13:41 +05:30
Kovid Goyal
158ebee92c
Unify metadata formatting between vide and animated image previews 2025-11-24 20:02:20 +05:30
Kovid Goyal
e2092d5e60
... 2025-11-23 18:37:26 +05:30
Kovid Goyal
aef9988c62
Allow configuring how video previews are generated 2025-11-23 18:28:59 +05:30
Kovid Goyal
abcd2ca884
Increase video preview resolution 2025-11-23 17:09:43 +05:30
Kovid Goyal
102ea9bf8b
... 2025-11-23 17:08:35 +05:30
Kovid Goyal
ccd16b82fa
Add support for video previews 2025-11-23 17:05:17 +05:30
Kovid Goyal
7c52f727dc
Show file metadata based preview with an error message when preview fails to render 2025-11-23 12:48:14 +05:30
Kovid Goyal
0c4cefd720
Fully fix flicker on first use of calibre preview backend
Also show the user the error from the calibre backend, if any
2025-11-23 12:39:30 +05:30
Kovid Goyal
5ecc221e70
DRYer 2025-11-23 12:32:23 +05:30
Kovid Goyal
24d6e0e629
Fix flicker on first transition to calibre backed preview 2025-11-23 12:30:46 +05:30
Kovid Goyal
fae50137a9
Add a clear cache action 2025-11-23 12:15:29 +05:30
Kovid Goyal
37da04aad6
choose files: Add default mappings to choose a file and insert it into the terminal 2025-11-23 11:41:21 +05:30
Kovid Goyal
29d2796692
Fix output format not being respected for STDOUT 2025-11-23 11:02:33 +05:30
Kovid Goyal
69a513d814
Run calibre metadata server process in the background 2025-11-23 10:46:32 +05:30
Kovid Goyal
2184d3b7d0
... 2025-11-23 10:24:40 +05:30
Kovid Goyal
ffac770cce
Add string reps for preview classes 2025-11-23 10:22:29 +05:30
Kovid Goyal
07b0801990
Nicer title for text file previews 2025-11-23 10:07:47 +05:30
Kovid Goyal
5047a46c94
... 2025-11-23 09:51:34 +05:30
Kovid Goyal
3a69e3e58f
Fix cache not being used for custom image preview rendered content without an image 2025-11-23 09:49:49 +05:30
Kovid Goyal
7f2d0aebe9
choose-files: Add calibre based previews for ebook/document file types 2025-11-23 09:39:08 +05:30
Kovid Goyal
4cf92fbf26
Make image preview code re-useable for other types of previews that have both metadata and an image 2025-11-22 13:21:21 +05:30
Kovid Goyal
9c3c6260c2
Show filename in text file preview 2025-11-22 12:39:29 +05:30
Kovid Goyal
4d4b287a4a
Show file name and extension for filetypes without previews 2025-11-22 12:32:50 +05:30
Kovid Goyal
75c3019756
Avoid flicker when changing preview
Only render the new preview when it is fully ready, keep showing
previous preview till then.
2025-11-22 12:24:09 +05:30
Kovid Goyal
c5bde715a7
Only unload preview when changed instead of on each render 2025-11-22 11:27:27 +05:30
Kovid Goyal
1d19942811
Store more metadata about pixel data shape when serializing 2025-11-15 12:23:56 +05:30
Kevin Klement
d979be915c
Update main.py
Fix misspellings of "within"
2025-11-11 08:33:05 -05:00
Kovid Goyal
6f588a0c29
run modernize 2025-11-11 17:09:37 +05:30
Kovid Goyal
1e6d67b975
Update to the latest version of imaging
Gives us a bunch of new features and allows us to move a bunch of code
into imaging
2025-11-06 22:31:31 +05:30
Kovid Goyal
b627d2e4ab
Move error handling code into its own library 2025-10-12 13:51:16 +05:30
Kovid Goyal
a0f6152aee
Ensure num_cols is never zero 2025-10-09 16:05:13 +05:30
Kovid Goyal
ed33e64101
Ensure placement is transmitted after data 2025-10-09 15:35:57 +05:30