Commit Graph

15 Commits

Author SHA1 Message Date
Arthur Sonzogni
f4b47333be
Featre: Support ctrl+arrow in input. (#494)
CTRL+LEFT: Move the cursor to the beginning of the word.
CTRL+RIGHT: Move the cursor to the beginning of the word.

This was requested by:
https://github.com/ArthurSonzogni/FTXUI/issues/490
2022-10-06 21:16:55 +02:00
Arthur Sonzogni
cdd6339849
Execute IWYU (#299) 2022-01-07 11:03:54 +01:00
Arthur Sonzogni
52276c8a2b
Bugfix Input use std::string (#279)
Use std::string by default for the implementation of FTXUI's input
component.

Along the way:
- Give a correct implementation for fullwidth characters.
- Add tests
- Modify the way the cursor is drawn.
2021-12-12 21:31:54 +01:00
Arthur Sonzogni
9a54528bca
Update examples to use std::string. (#182)
In examples and tests, use std::string.

In addtion:
1. Address follow-up from:
https://github.com/ArthurSonzogni/FTXUI/pull/179
2. Fix a bug when Input is used with std::string.
2021-08-09 00:27:37 +02:00
Arthur Sonzogni
3b4ab618a3
Prefer std::string over std::wstring. (#179)
In the past, FTXUI switched from std::string to std::wstring to support
fullwidth characters. The reasons was that fullwidth characters can be
stored inside a single wchar_t.

Then FTXUI added support for combining characters. A single glygh
doesn't even fit a wchar_t. Instead, a glyph can be arbitrary large.

The usage of wstring doesn't really fit the new model and have several
drawbacks:
1. It doesn't simplify the implementation of FTXUI, because of combining
   characters.
2. It reduces drawing performance by 2x.
3. It increase Screen's memory allocation by 2x.

This patch converts FTXUI to use std::string internally. It now exposes
std::string based API. The std::wstring API remains, but is now
deprecated.

Tests and examples haven't been update to show the breakage is limited.
They will be updated in a second set of patches.

Bug: https://github.com/ArthurSonzogni/FTXUI/issues/153
Co-authored-by: Tushar Maheshwari <tushar27192@gmail.com>
2021-08-08 23:25:20 +02:00
ArthurSonzogni
cd84b187b3 Introduce Options and use them for Menu.
Introduce Options for components. This allows me to add new features,
without updating functions signatures.
2021-07-11 12:23:42 +02:00
Arthur Sonzogni
87a1d75bf1
Fix unsigned/signed comparison issues. (#103)
Seen here:
https://github.com/VedantParanjape/simpPRU/runs/2613171696
2021-05-18 21:48:32 +02:00
Arthur Sonzogni
2723616dc8
Make StringRef borrow reference only when taking a pointer. (#91) 2021-05-15 01:34:37 +02:00
ArthurSonzogni
048efb6912
Add {Const,}StringRef to simplify components. 2021-05-14 21:47:51 +02:00
ArthurSonzogni
f2dc080a35 Variou details:
- Put the MIT copyright at the end.
- Move the directory /other -> tools
- Various improvements.
2020-08-28 23:54:25 +02:00
ArthurSonzogni
20b9a0f0f5 Add a doxygen documentation. 2020-08-15 10:38:14 +02:00
ArthurSonzogni
f506be941d Add automatic formatting and license. 2020-04-19 21:01:09 +02:00
ArthurSonzogni
493e734680 Set clang-format macro indent.
1) Set clang-format macro indent.
2) Run clang-format on every files.
2020-03-23 21:26:00 +01:00
ArthurSonzogni
eb6baaceea Support full-width characters (CJK)
+ 3 tests.

The goal is to fix:
https://github.com/ArthurSonzogni/FTXUI/issues/2#issuecomment-504871456
2019-06-24 23:39:37 +02:00
ArthurSonzogni
ef0de8d873 Add support for nxxm.
[nxxm](https://nxxm.github.io)
2019-02-02 02:25:06 +01:00