Commit graph

53 commits

Author SHA1 Message Date
Hojjat
bc40cde8cb fix: do not subtract the scroll twice, causing highlight mis-alignment 2026-03-31 14:54:53 -04:00
Hojjat
e1fc659e64 fix: use highlight and cursor from cosmic-text editor
This fixes RTL text in the text_editor widget.
2026-03-31 14:54:53 -04:00
Héctor Ramón Jiménez
4428f31b4f
Add move_to method to Editor 2025-12-01 20:11:42 +01:00
Héctor Ramón Jiménez
63e9eeffb5
Refactor cursor API in Editor
Co-authored-by: Neeraj Jaiswal <neerajj85@gmail.com>
2025-12-01 19:57:27 +01:00
Zero
3310dc79db
Fix text_editor syntax highlighting on paste
Fixes #2946.
2025-11-26 00:07:15 +01:00
Héctor Ramón Jiménez
b500cd85e7
Fix panic when mouse-scrolling a text_editor 2025-11-01 01:41:45 +01:00
Héctor Ramón Jiménez
439f4e32ac
Update cosmic-text to 0.15 🎉 2025-10-31 16:15:31 +01:00
Héctor Ramón Jiménez
d5cd0a6de9
Fix lints for Rust 1.89 and bump MSRV to 1.88 2025-08-07 22:38:22 +02:00
Juniper
0b6e0667ae Indent and Unindent Text Editor Actions 2025-04-24 17:20:19 -04:00
Héctor Ramón Jiménez
6bf6fc60c9
Update cosmic-text to 0.14 2025-04-09 18:40:38 +02:00
Héctor Ramón Jiménez
179a34d37b
Fix horizontal text alignment 2025-03-11 00:43:51 +01:00
Héctor Ramón Jiménez
201245a85d
Update cosmic-text to 0.13 2025-03-10 19:54:04 +01:00
Héctor Ramón Jiménez
7979125ed7
Simplify InputMethod API with only two states
Co-authored-by: rhysd <lin90162@yahoo.co.jp>
Co-authored-by: KENZ <KENZ.gelsoft@gmail.com>
2025-02-12 08:46:35 +01:00
Héctor Ramón Jiménez
87165ccd29
Introduce LineEnding to editor and fix inconsistencies 2025-01-28 06:23:38 +01:00
Héctor Ramón Jiménez
529c459c56
Remove unnecessary buffer_mut_from_editor call 2024-09-04 21:28:44 +02:00
Héctor Ramón Jiménez
f98328f4f1
Add text::Wrapping support
Co-authored-by: Neeraj Jaiswal <neerajj85@gmail.com>
2024-09-04 21:26:47 +02:00
Héctor Ramón Jiménez
e9e06c8fe2
Add placeholder support to text_editor widget 2024-07-24 14:52:01 +02:00
Héctor Ramón
616689ca54
Update cosmic-text and resvg (#2416)
* Update `cosmic-text`, `glyphon`, and `resvg`

* Fix slow font fallback with `Shaping::Basic` in `cosmic-text`

* Update `cosmic-text` and `resvg`

* Update `cosmic-text`

* Fix `SelectAll` action in `editor`

* Fix some panics in `graphics::text::editor`

* Remove empty `if` statement in `tiny_skia::vector`

* Update `cosmic-text`, `glyphon`, and `rustc-hash`
2024-07-17 13:00:00 +02:00
PgBiel
76f5bc2cce
add SelectAll to TextEditor 2024-07-08 01:16:31 +02:00
Héctor Ramón Jiménez
6c1027af8d
Fix text_editor always capturing scroll events 2024-06-17 03:37:00 +02:00
Héctor Ramón Jiménez
3762c0590c
Fix panic when scrolling a TextEditor inside a scrollable 2024-04-26 15:17:10 +02:00
Héctor Ramón Jiménez
2ba73b0faf
Fix wrapped lines not being considered when measuring TextEditor 2024-02-07 21:48:28 +01:00
Héctor Ramón Jiménez
625cd745f3
Write documentation for the new text APIs 2023-10-27 05:04:14 +02:00
Héctor Ramón Jiménez
4e757a26d0
Implement Scroll action in text::editor 2023-09-19 01:18:06 +02:00
Héctor Ramón Jiménez
e7326f0af6
Flesh out the editor example a bit more 2023-09-18 19:07:41 +02:00
Héctor Ramón Jiménez
61ef8f3249
Update version properly when FontSystem changes in text::editor 2023-09-18 13:58:55 +02:00
Héctor Ramón Jiménez
b5466f41ca
Fix inconsistent expect messages in text::editor 2023-09-18 13:58:39 +02:00
Héctor Ramón Jiménez
a01b123cec
Shape as needed only in update during layout 2023-09-18 13:57:47 +02:00
Héctor Ramón Jiménez
d1440ceca6
Find correct last_visible_line in Editor::highlight 2023-09-18 13:39:47 +02:00
Héctor Ramón Jiménez
86d396cf8b
Avoid adding unnecessary spans when syntax highlighting 2023-09-17 23:15:38 +02:00
Héctor Ramón Jiménez
2897986f2d
Notify Highlighter of topmost line change 2023-09-17 19:27:51 +02:00
Héctor Ramón Jiménez
23d00445ff
Use saturating_sub for last_visible_line in text::Editor 2023-09-17 19:06:20 +02:00
Héctor Ramón Jiménez
d3011992a7
Implement basic syntax highlighting with syntect in editor example 2023-09-17 19:04:23 +02:00
Héctor Ramón Jiménez
76dc82e8e8
Draft Highlighter API 2023-09-17 15:29:14 +02:00
Héctor Ramón Jiménez
c9dbccba46
Use fork of cosmic-text with some minor fixes 2023-09-16 16:27:02 +02:00
Héctor Ramón Jiménez
d051f21597
Implement Copy and Paste actions for text::Editor 2023-09-16 15:40:16 +02:00
Héctor Ramón Jiménez
c6d0443627
Implement methods to query the contents of a TextEditor 2023-09-16 15:27:25 +02:00
Héctor Ramón Jiménez
3afac11784
Remove min_bounds field in graphics::text::Editor 2023-09-14 18:58:52 +02:00
Héctor Ramón Jiménez
c7d02e24e6
Remove Editor::min_bounds and use bounds instead 2023-09-14 18:57:09 +02:00
Héctor Ramón Jiménez
8cad1d682a
Implement Action::SelectLine in text::Editor 2023-09-14 15:23:20 +02:00
Héctor Ramón Jiménez
f7d66899f1
Implement Action::SelectWord in text::Editor 2023-09-14 15:20:23 +02:00
Héctor Ramón Jiménez
edd5918475
Implement motion selection in text::Editor 2023-09-14 14:25:46 +02:00
Héctor Ramón Jiménez
b24b94d827
Handle motions when a selection is present in text::Editor 2023-09-14 14:18:49 +02:00
Héctor Ramón Jiménez
e6c2db8a93
Fix Cursor::Caret position on lines that wrap on whitespace 2023-09-14 00:47:04 +02:00
Héctor Ramón Jiménez
ab020383b9
Fix scrolling offset for Cursor::Selection 2023-09-14 00:41:15 +02:00
Héctor Ramón Jiménez
f14ef7a606
Fix clippy lints 2023-09-13 16:31:56 +02:00
Héctor Ramón Jiménez
f4c51a96d5
Introduce Motion concept in core::text::editor 2023-09-13 16:11:43 +02:00
Héctor Ramón Jiménez
40eb648f1e
Implement Cursor::Selection calculation in Editor::cursor 2023-09-13 15:00:33 +02:00
Héctor Ramón Jiménez
a28ed825c1
Fix subline positioning in Editor::cursor 2023-09-12 20:57:46 +02:00
Héctor Ramón Jiménez
4389ab9865
Fix cursor offset with Affinity::After at the end of lines in Editor::cursor 2023-09-12 18:27:30 +02:00