Commit Graph

97 Commits

Author SHA1 Message Date
Kovid Goyal
e45697f78a
Fix a regression that broke rendering of unicode regional indicators
At some point, unicode regional indicators became combining chars in the
unicode standard, which broke the handling of them in draw_codepoint().
The fix has the added advantage of improving performance in the common
case by only checking for combining chars. The flag check happens only
if the first check matches.

Fixes #4407
2021-12-31 09:28:47 +05:30
Kovid Goyal
62dbc1129c
When setting the OS Window title strip out CSI escape codes
Fixes #4325
2021-12-08 16:04:23 +05:30
Kovid Goyal
2443dc135c
Use a faster implementation of the Color type
Now implemented in C
2021-10-28 11:15:13 +05:30
Kovid Goyal
6546c1da9b
run pyupgrade to upgrade the codebase to python3.6 2021-10-21 12:43:55 +05:30
Kovid Goyal
fbf47f75d5
Fix soft hyphens not being preserved when round tripping text through the terminal
Also roundtrip all characters in the Cf category.

Characters with the DI (Default Ignorable) property are now
preserved but not rendered and treated as zero-width
as per the unicode standard.
See https://www.unicode.org/faq/unsup_char.html
2021-10-07 12:44:22 +05:30
Kovid Goyal
780e526143
Use a union for cell attributes
Cleaner code, no performance impact
2021-08-18 10:06:08 +05:30
Kovid Goyal
81411e6b54
Fix trailing parentheses in URLs not being detected
Also fix URLs starting near the end of the line not being detected.

Fixes #3688
2021-06-04 18:13:36 +05:30
Kovid Goyal
444080f320
Make wcswidth useable in a streaming fashion 2020-09-21 15:55:22 +05:30
Kovid Goyal
6461dccbdc
Make wcswidth ignore more escape codes
Needed to ignore OSC 8 hyperlinks since we will
eventually have to send those with SGR formatting to the hints
kitten.
2020-09-17 20:16:17 +05:30
Kovid Goyal
0862e85577
Rewrite wcswidth as a state machine 2020-04-07 10:10:30 +05:30
Kovid Goyal
6357f7b811
Update wcswidth() to match new country flag rendering 2020-04-06 22:56:34 +05:30
Kovid Goyal
12f37bcfad
Dont strip trailing punctuation from end of URL if next line startswith url characters 2020-03-15 08:47:52 +05:30
Kovid Goyal
e86c712424
Dont strip :code:& and :code:- from the end of URLs
Fixes #2436
2020-03-15 08:29:56 +05:30
Kovid Goyal
645890ccc8
Make the set of URL prefixes that are recognized while hovering with the mouse configurable
Fixes #2416
2020-03-08 13:16:34 +05:30
Kovid Goyal
43326c9bd0
Fix URL detection not working for urls of the form scheme:///url
Fixes #2292
2020-01-17 07:49:01 +05:30
Luflosi
2751dbdb94
Fix test_url_at
`lspace_test()` has a parameter called scheme with the default value `http`. It
is called in a nested for loop, but the scheme from the inner for loop is
just ignored.
2019-06-05 18:32:23 +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
fe882dad15
Add support for Vs-15 to wcswidth 2019-05-13 19:50:49 +05:30
Kovid Goyal
d20c65ef80
Graphics protocol: Only delete temporary image-data files if they are in a known temporary file location 2018-12-11 10:00:43 +05:30
Kovid Goyal
47ec372c30
Fix hover detection of URLs not working when hovering over the first colon and slash characters in short URLs
Fixes #1201
2018-12-04 06:52:26 +05:30
Dominique Martinet
c421d3bb59 line_as_ansi: don't reset SGR at start of line
less does not carry the mode over from the previous line anyway, let's
save a few bytes for every line
2018-09-22 19:10:09 +09:00
Kovid Goyal
5fa5bf8142
Add a test for unicode regional indicator widths 2018-08-04 10:56:35 +05:30
Kovid Goyal
6f2d63eb87
Implement SGR dim
kitty now supports the SGR DIM escape code, which makes text fade into
the background. It works by alpha blending the text color into the
background color. Fixes #446
2018-05-20 10:43:26 +05:30
Kovid Goyal
3f316c39d1
Dynamically allocate the scrollback history buffer
Reduces startup memory consumption when using very large scrollback
buffer sizes.
2018-05-03 15:17:02 +05:30
Kovid Goyal
0be0963dc7
Utility method to truncate formatted lines to specified width 2018-04-25 19:34:04 +05:30
Kovid Goyal
19648257f2
Have wcwidth() ignore SGR 2018-02-12 10:19:29 +05:30
Kovid Goyal
f4f0b8fd5f
Kittens learn about bracketed paste 2018-02-07 10:39:05 +05:30
Kovid Goyal
22cf67b407
More work on tui.loop 2018-02-06 20:08:28 +05:30
Kovid Goyal
fa87ce72a8
A terminal input parse helper for the kittens 2018-02-06 17:29:05 +05:30
Kovid Goyal
e830b7edf7
Add emoji presentation variation selector support to wcswidth() as well 2018-02-06 10:16:23 +05:30
Kovid Goyal
b9857f9499
Only consider emoji characters with emoji presentation to have width two
Fixes #308
2018-02-05 09:21:13 +05:30
Kovid Goyal
3f24e5b571
A few more places to remove wcwidth from 2018-02-04 22:47:02 +05:30
Kovid Goyal
fc7ec1d3f7
Get rid of the option to use the system wcwidth
The system wcwidth() is often wrong. Not to mention that if you SSH into
a different machine, then you have a potentially different wcwidth. The
only sane way to deal with this is to use the unicode standard.
2018-02-04 21:02:30 +05:30
Kovid Goyal
80301d465b
Handle non-BMP combining characters
Use a level of indirection to store combining characters. This allows
combining characters to be stored using only two bytes, even if they are
after USHORT_MAX
2018-01-18 16:25:42 +05:30
Kovid Goyal
7ed835cf13
Fix a crash when detecting URLs continued onto multiple lines
Fixes #244
2017-12-27 06:35:09 +05:30
Kovid Goyal
27cd303a05
Centralize code to convert to SGR
Conversion from formatting attributes to SGR now always goes through a
Cursor.
2017-12-04 10:51:06 +05:30
Kovid Goyal
73b501c961
Make color parsing a little more robust
Add a few tests for it
2017-12-01 20:02:47 +05:30
Kovid Goyal
6c838bbc28
Implement dirty line tracking 2017-11-09 16:55:45 +05:30
Kovid Goyal
898e87aa7b
Dont allocate space for dummy fonts
Also move sprite_map test into fonts test module
2017-11-09 16:55:42 +05:30
Kovid Goyal
f25d2ea540
Rip out the old sprite update code 2017-11-09 16:45:45 +05:30
Kovid Goyal
2443d76ac3
Apparently pep8 now just does not let you use the name l
This is one of the most hilarious bugs in pep8 I have come across
2017-10-23 17:40:53 +05:30
Kovid Goyal
8b54df31ef
Fix new pep8 ambiguous name warning 2017-10-23 17:33:57 +05:30
Kovid Goyal
3ca45ab241
Fix cursor moving one line up when resizing 2017-09-20 10:59:31 +05:30
Kovid Goyal
464291bbb1
Port click on URL code to C 2017-09-15 10:45:27 +05:30
Kovid Goyal
271b623f82
More URL detection tests 2017-09-15 10:45:25 +05:30
Kovid Goyal
88d896e745
Move function to detect URLs into C code 2017-09-15 10:45:25 +05:30
Kovid Goyal
c683725434
Get rid of the timers infrastructure
It is not needed with a pure state machine.
Note that drag scrolling still has to be ported from using
timers.
2017-09-15 10:45:24 +05:30
Kovid Goyal
bc97cfa024
Use a null to represent a blank rather than a space
This has performance benefits when clearing (can use a single
memset). Also allows detecting trailing whitespace on lines correctly.
2017-09-15 10:45:16 +05:30
Kovid Goyal
6127d2d122
Make the sprite map globally accessible from C code as well as python code
The lock was removed as the Python GIL is sufficient to serialize access
to the SpriteMap structure.
2017-09-15 10:45:10 +05:30
Kovid Goyal
a429bcbb22
Dont use the glfw timer function as it requires glfwInit 2017-09-15 10:45:07 +05:30