168 Commits

Author SHA1 Message Date
Kovid Goyal
96d5c9c7c6 A new option to clear selections when they no longer reflect the contents of the clipboard 2025-03-12 11:41:27 +05:30
Kovid Goyal
da1626090a Update codebase to Python 3.10 using pyupgrade 2025-02-03 10:56:50 +05:30
Kovid Goyal
8931062a70 hints kitten: Workaround for some broken light color themes that make the hints text color too low contrast to read
Fixes #7330
2025-01-17 20:22:10 +05:30
Kovid Goyal
2d02ff1c5f Implement using effective kitty config options for kittens
Also centralise reading of kitty options
2025-01-05 20:16:43 +05:30
Kovid Goyal
9d48fa9126 hints/unicode_input kittens: Do not lose keypresses that are sent very rapidly via an automation tool immediately after the kitten is launched
We now buffer the key events until the kitten tells us it is ready.
Without this the key presses are delivered to the underlying window
as the kitten's overlay window was not being focused until the kitten
set the ready message.

Fixes #7089
2024-12-12 13:11:12 +05:30
Kovid Goyal
405f5ce148 Use stdlib maps/slices 2024-06-24 07:54:13 +05:30
Kovid Goyal
8c1e365eb5 hints kitten: Allow clicking on matched text to select it in addition to typing the hint 2024-05-14 15:22:03 +05:30
Kovid Goyal
5e125c35d1 hints kitten: Report the pattern used when no matches are found 2024-04-20 05:14:03 +05:30
Kovid Goyal
c3c99113c7 hints kitten: Use default editor rather than hardcoding vim to open file at specific line
Fixes #7186
2024-03-04 21:49:06 +05:30
Kovid Goyal
a5f3142514 hints kitten: The option to set the text color for hints now allows arbitrary colors
Fixes #7150
2024-02-25 10:02:38 +05:30
Kovid Goyal
bc3c9ce2fa Fix #7100 2024-02-05 20:48:49 +05:30
Kovid Goyal
9bea8bb5bc remove no longer needed code 2024-02-05 13:54:22 +05:30
Kovid Goyal
8cc2cad4d9 Use list of legal chars in URL from the WHATWG standard
Notably this excludes some ASCII chars: <>{}[]`|
See https://url.spec.whatwg.org/#url-code-points

Fixes #7095
2024-02-05 13:27:22 +05:30
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
dc6edf9191 Improve the docs for how to match multi-line hints
See #6692
2023-10-17 15:23:58 +05:30
Kovid Goyal
70a588cb36 ... 2023-10-17 15:23:43 +05:30
Kovid Goyal
0a2f164062 Change kitty +kitten -> kitten in docs
All kittens except for the broadcast and panel kittens have now been
ported to Go and so can be run with just kitten rather than kitty
+kitten. So update the docs to use this canonical form for launching
kittens
2023-09-21 12:25:02 +05:30
Kovid Goyal
4f72bb9894 Replace utils.Once with stdlib sync.OnceValue 2023-08-09 12:08:42 +05:30
Kovid Goyal
49ea26968c Bump go version to 1.21
Allows us to use the much faster builtin min/max functions
for two variable min/max
2023-08-09 11:58:16 +05:30
Kovid Goyal
8670ede032 DRYer 2023-06-29 07:39:42 +05:30
Kovid Goyal
da1276d84a Correct the naming of the window arg to call_remote_control 2023-06-10 09:47:37 +05:30
Kovid Goyal
0873e3ea09 ... 2023-05-31 07:22:49 +05:30
Kovid Goyal
9bbb2a9ef4 Fix #6315 2023-05-31 07:08:55 +05:30
Kovid Goyal
e59e42a6c2 simplify API of utils.Once 2023-05-26 22:42:07 +05:30
Kovid Goyal
c101a6acb0 Implement a dedicated function for word matching rather than relying on a regex and being at the mercy of the vagaries of regex implementations 2023-05-12 15:43:56 +05:30
Kovid Goyal
65f8bb7397 hints kitten: Switch to using a regex engine that supports lookaround
Note that we loose unicode char matching for --type=word because of
https://github.com/dlclark/regexp2/issues/65 and of course user regexps
cant use \p{N} escapes any more. Hopefully regexp2 will add support for
these soon-ish. IMO lookaround is more important than \p.

Fixes #6265
2023-05-12 12:24:59 +05:30
Kovid Goyal
1fc4e53bea hints kitten: Fix a regression in 0.28.0 that broke using sub-groups in regexp captures
Fixes #6228
2023-04-30 21:16:24 +05:30
Kovid Goyal
7b6d11fd1e Fix rendering of :doc: links with explicit titles in help text in the terminal 2023-04-26 16:46:20 +05:30
Kovid Goyal
bb33c66570 Fix #6213 2023-04-26 16:38:25 +05:30
Kovid Goyal
e095a2ab43 Fix #6142 2023-03-28 21:06:39 +05:30
Kovid Goyal
ff55121094 Move the kittens Go code into the kittens folder 2023-03-27 13:06:02 +05:30
Kovid Goyal
e4611d0c81 ... 2023-03-17 09:02:58 +05:30
Kovid Goyal
b76b0c61ed Port custom processor for hints 2023-03-10 10:45:37 +05:30
Kovid Goyal
69916ca4e8 Remove python implementation of hints 2023-03-10 07:16:25 +05:30
Kovid Goyal
5b3f5dd02d Port all remaining hints matching tests 2023-03-09 20:53:46 +05:30
Kovid Goyal
0e5ed29d83 Fix generation of url regex for Go 2023-03-09 19:00:56 +05:30
Kovid Goyal
09ceb3c0be Start work on porting hints kitten to Go 2023-03-09 19:00:56 +05:30
pagedown
4c9d90efbb hints kitten: Perform copy action with --program when matching linenum 2023-03-02 10:30:17 +08:00
Kovid Goyal
eb6d777790 ... 2023-03-01 20:34:09 +05:30
Kovid Goyal
81f8ed6b45 Use @ rather than # for named buffers prefix char
Matches existing use of @ for clipboard. Also @ doesnt need to be quoted
in most shells.
2023-03-01 19:54:03 +05:30
pagedown
854529c443 hints kitten: Allow copying matches to named buffers 2023-03-01 22:10:24 +08:00
Kovid Goyal
7fe5d7b58f Replace isort with ruff 2023-01-09 16:47:42 +05:30
pagedown
13a3c6b5b2 Update to Unicode 15.0 2022-09-29 10:13:21 +08:00
Kovid Goyal
7e1380cc0d Start work on giving GLFW a proper clipboard API 2022-09-08 12:45:34 +05:30
Kovid Goyal
295743a96e Fix ref to launch doc 2022-09-02 16:31:21 +05:30
Kovid Goyal
9cec924f32 hints kitten: Allow using launch as the program to run, to open the result in a new kitty tab/window/etc.
Fixes #5462
2022-09-02 16:23:00 +05:30
Kovid Goyal
afada84f52 Cleanup previous PR
Use wcswidth() for line width calculation. Works with emoji and ignores
escape codes automatically. Add changelog entry.
2022-08-31 08:01:52 +05:30
Trygve Aaberge
03720402a7 Fix hints sometimes matching next line as part of URL
For URLs where there's fewer characters left to the right edge of the
window than the number of escape characters in the line, the next line
would be included in the URL, as if the URL went all the way to the
right edge.

For example with a 40 chars wide terminal, if you run:

    echo -e '\e[31m1\e[m https://github.com/kovidgoyal/kitty\ntest'

And launch the hints kitten, you'll see that test on the next line will
be included in the URL.

This happened because the calculation for filling the rest of the line
with NUL characters counted the escape characters as well as the visible
characters, so it filled in too few characters.

This is a regression introduced in commit 91966712.
2022-08-30 22:24:58 +02:00
Kovid Goyal
98f6e24106 Move block outside try/except as it doesnt need to be in there 2022-06-06 08:17:15 +05:30
Kovid Goyal
cd7751681d hints kitten: Fix surrounding quotes/brackets and embedded carriage returns not being removed when using line number processing
Fixes #5170
2022-06-05 18:07:16 +05:30