summaryrefslogtreecommitdiffstats
path: root/utf8.c
AgeCommit message (Collapse)Author
2023-07-03Another warning fix for GCC from Thomas Klausner.nicm
2023-06-30Change a few types to fix warnings, from Thomas Klausner.nicm
2023-01-08Restore code to handle wcwidth failure so that unknown codepoints stillnicm
do the most likely right thing. GitHub issue 3427, patch based on an diff from Jesse Luehrs in GitHub issue 3003.
2022-12-16Make U+FE0F VARIATION SELECTOR-16 change the width from 1 to 2. GitHubnicm
issue 3409.
2021-06-10More accurate vi(1) word navigation in copy mode and on the status line.nicm
This changes the meaning of the word-separators option - setting it to the empty string is equivalent to the previous behavior. From Will Noble in GitHub issue 2693.
2020-09-16Fix some warnings, GitHub issue 2382.nicm
2020-07-21Fix show-buffer when run from inside tmux, GitHub issue 2314.nicm
2020-06-09Include width in error message.nicm
2020-06-09It is not sensible to store pointers into an array we are going tonicm
realloc (duh), use two trees instead.
2020-06-06Use bitshifts instead of a union for encoding UTF-8 into 32 bits, whichnicm
is more friendly to GCC3. Reported by and ok aoyama@.
2020-06-02Allow UTF-8 characters of width 0 to be stored, it is useful to be ablenicm
to put padding cells in as width 0.
2020-06-02UTF-8 keys need to be big endian so the size bits are at the top.nicm
2020-06-02Fail rather than fatal on UTF-8 width 0.nicm
2020-05-26Return new character properly when converting to data.nicm
2020-05-25Use the internal representation for UTF-8 keys instead of wchar_t andnicm
drop some code only needed for that.
2020-05-25Tidy up new UTF-8 code and make it more generic.nicm
2020-05-25Make some data types consistent.nicm
2020-05-25Instead of storing all UTF-8 characters in the extended cell which meansnicm
that 14 bytes are wasted for each character in the BMP, only store characters of three bytes or less in the cell itself and store others (outside the BMP or with combining characters) in a separate global tree. Can reduce grid memory use for heavy Unicode users by around 30%.
2019-11-25Add p format modifier for padding to width.nicm
2019-05-26Add formats for word and line under the mouse and use them to add somenicm
items to the pane menu.
2019-05-23Environment variables can start with { also.nicm
2019-05-23Break the argument escaping code into a separate function and use it tonicm
escape key bindings in list-keys. Also escape ~ and ; and $ properly.
2019-03-18Extend the #[] style syntax and use that together with previous formatnicm
changes to allow the status line to be entirely configured with a single option. Now that it is possible to configure their content, enable the existing code that lets the status line be multiple lines in height. The status option can now take a value of 2, 3, 4 or 5 (as well as the previous on or off) to configure more than one line. The new status-format array option configures the format of each line, the default just references the existing status-* options, although some of the more obscure status options may be eliminated in time. Additions to the #[] syntax are: "align" to specify alignment (left, centre, right), "list" for the window list and "range" to configure ranges of text for the mouse bindings. The "align" keyword can also be used to specify alignment of entries in tree mode and the pane status lines.
2017-06-04Remove unused variable.nicm
2017-06-04Be more strict about escape sequences that rename windows or set titles:nicm
ignore any that not valid UTF-8 outright, and for good measure pass the result through our UTF-8-aware vis(3).
2017-05-31Style and spacing nits.nicm
2017-03-17Fix a couple of argument types.nicm
2017-01-18Plain stravis() because it will mangle UTF-8 characters, so addnicm
utf8_stravis() which calls our existing utf8_strvis() and use it instead
2016-10-11Support UTF-8 entry into the command prompt.nicm
2016-05-27Most of the utf8_data is fixed so simplify utf8_set to use a memcpy.nicm
2016-04-29OpenBSD wcwidth() is sensible and complete so if it returns -1 it meansnicm
that a character is not printable, so return to ignoring such characters.
2016-04-27Loads of platforms appear to have old or broken Unicode character typenicm
information and are missing widths for relatively common Unicode characters (so mbtowc() works, but wcwidth() fails). So if wcwidth() returns -1, assume a width of 1 instead of ignoring the character.
2016-04-26Log wcwidth() and mbtowc() failure to make it easier to debug a Unicodenicm
codepoint not appearing.
2016-03-02Handle wcwidth() and mbtowc() failures in better style and dropnicm
characters where we can't find the width (wcwidth() fails) on input, the same as we drop invalid UTF-8. Suggested by schwarze@.
2016-03-01Use system wcwidth() instead of carrying around UTF-8 width tables.nicm
2016-01-31Whoops, need this for the previous reverse trim commit too.nicm
2016-01-19I no longer use my SourceForge address so replace it.nicm
2015-11-20Memory leaks and an uninitialized part of utf8_data, from Patrick Palka.nicm
2015-11-14The private use area at U+E000 to U+F8FF is not very useful if it isnicm
width 0, make it width 1 instead.
2015-11-14All these return values from utf8_* are confusing, use an enum.nicm
2015-11-14Rename a variable in utf8_combine for consistency and use 0xfffd fornicm
unknown Unicode.
2015-11-14Be more strict about invalid UTF-8.nicm
2015-11-13Long overdue change to the way we store cells in the grid: now, insteadnicm
of storing a full grid_cell with UTF-8 data and everything, store a new type grid_cell_entry. This can either be the cell itself (for ASCII cells), or an offset into an extended array (per line) for UTF-8 data. This avoid a large (8 byte) overhead on non-UTF-8 cells (by far the majority for most users) without the complexity of the shadow array we had before. Grid memory without any UTF-8 is about half. The disadvantage that cells can no longer be modified in place and need to be copied out of the grid and back but it turned out to be lot less complicated than I expected.
2015-11-12Rename overly-long utf8data to ud throughout.nicm
2015-11-12Add utf8_padcstr and use it to align columns in list-keys.nicm
2015-11-12Tidy utf8.c a little: build table on first use, and make utf8_width takenicm
a u_int rather than splitting and then combining again in utf8_split.
2015-11-12If we know the terminal outside tmux is not UTF-8, replace UTF-8 innicm
error messages and whatnot with underscores the same as we do when we draw UTF-8 characters as part of the screen.
2015-11-12Support UTF-8 key bindings by expanding the key type from int tonicm
uint64_t and converting UTF-8 to Unicode on input and the reverse on output. (This allows key bindings, there are still omissions - the largest being that the various prompts do not accept UTF-8.)
2015-11-05Update the internal wcwidth(3) table of tmux(1) to match the dataschwarze
in /usr/src/share/locale/ctype/en_US.UTF-8.src, with one single exception: Keep U+00AD SOFT HYPHEN at width 1 rather than moving it to width 0, a tradition already observed in the old https://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c . While here, manually rebalance the btree for optimal lookup speed. OK nicm@
2015-04-20Style nit - unnecessary brackets.nicm