Commit graph

49 commits

Author SHA1 Message Date
Jeremy Soller
d0b4b4635e Refactor of scroll and shaping
- Scroll is identified by line index and layout index, instead of just
  layout index
- Shaping has the option to prune, where caches outside of the scroll
  view are cleared
- Syntax editor no longer requires layout of all lines, only of lines
  inside scroll
- BufferLine has a metadata field that can be used by other abstractions
  to know when text was changed
2024-01-17 13:31:03 -07:00
Jeremy Soller
018a2e9d2a Move cursor motions to new Motion enum, move handling to Buffer 2024-01-17 13:31:03 -07:00
Jeremy Soller
659001dad8 editor-orbclient: fix scaling 2023-11-07 15:56:43 -07:00
Jeremy Soller
3c7dc1f657
Remove monospaced from attrs 2023-03-30 08:04:52 -06:00
Edgar Geier
384c5c1fdc
Remove Mutex from FontSystem 2023-03-12 10:39:56 +01:00
Edgar Geier
46e9ef0246
Make BorrowedWithFontSystem borrow FontSystem mutably 2023-03-12 10:39:56 +01:00
Edgar Geier
057b5b6fa9
Extract borrow of FontSystem from Buffer 2023-03-12 10:39:54 +01:00
Jeremy Soller
bd27ca8ad8
Merge pull request #88 from geieredgar/clippy-fixes
Fix clippy warnings
2023-03-02 14:53:08 -07:00
Edgar Geier
6c501c6640
Fix clippy warnings 2023-03-01 22:58:41 +01:00
Edgar Geier
4e93853765
Remove lifetime from SwashCache 2023-03-01 22:41:59 +01:00
Héctor Ramón Jiménez
4320ae6329
Use f32 instead of i32 for lengths
This allows users to use logical coordinates instead of physical ones.
2023-02-28 03:39:31 +01:00
Jeremy Soller
8cc988d374 Run cargo fmt 2023-01-04 20:03:03 -07:00
Jeremy Soller
ee54e7626b
Vi-style editor and other editor improvements (#40)
* WIP VI wrapper for editor

* WIP: block cursor

* Create Edit trait, run CI on all feature options

* Add prints describing build steps to ci.sh

* Custom rendering for Vi editor

* Clippy fixes

* More clippy fixes

* Show clippy results in CI

* Fix for Redox

* Fix clippy lint

* Add vi feature to enable vi-style editor

* Add escape to libcosmic text box
2022-11-15 12:26:59 -07:00
Jeremy Soller
bbe7d77b7b
Improvements to syntax editor, integrate with libcosmic editor 2022-11-09 10:44:51 -07:00
Jeremy Soller
1663bfc96c
Add SyntaxEditor abstraction using optional synect feature 2022-11-09 10:09:42 -07:00
Jeremy Soller
92cad6fe13
Decouple editing from buffer 2022-10-31 11:24:36 -06:00
Jeremy Soller
e4c8d4ba6b
Make attribute spans use ranges and update docs 2022-10-27 09:56:53 -06:00
Jeremy Soller
16f0eb9efe
Re-add scrollbar to orbclient editor 2022-10-27 09:18:27 -06:00
Jeremy Soller
212afb1561
Merge syntax into orbclient editor 2022-10-27 09:16:21 -06:00
Jeremy Soller
3ece9236b3
Use Color in more places 2022-10-27 09:07:47 -06:00
Jeremy Soller
536c24355c
Always redraw on resize 2022-10-26 18:13:14 -06:00
Jeremy Soller
119a570ee9
Cache font matches, use usize for line index, use font system for swash 2022-10-26 12:23:03 -06:00
Jeremy Soller
e53956cb2d Fix scrolling with cursor 2022-10-25 20:49:15 -06:00
Jeremy Soller
59a4f8a4c1
Produce FontMatches inside of Buffer 2022-10-25 16:13:07 -06:00
Jeremy Soller
c60aaaf9d2
Ensure orbclient example reshapes 2022-10-25 15:33:48 -06:00
Jeremy Soller
84f4381cdf
Add text attributes 2022-10-25 14:14:23 -06:00
Jeremy Soller
330a736136
Add function to get layout runs 2022-10-25 11:40:10 -06:00
Jeremy Soller
0f446368ca
Have TextBuffer own FontMatches 2022-10-25 11:10:44 -06:00
Jeremy Soller
42de42d59e
Do not store reference to font in shape or layout glyphs 2022-10-25 10:13:44 -06:00
Jeremy Soller
3c573df261
Do not set async by default 2022-10-25 09:31:51 -06:00
Jeremy Soller
a19182507b
Set orbclient async mode when edge scrolling 2022-10-25 09:30:16 -06:00
Jeremy Soller
d04147e1fc
Reduce framerate of orbclient example 2022-10-25 09:03:39 -06:00
Andrew Wheeler(Genusis)
079778cbf9 Moved the shape until cursor outside of the loop 2022-10-25 08:58:40 -06:00
Andrew Wheeler(Genusis)
16ebfcf6e6 Fixed the way drag selection scrolling works. made main buffer only run once and events do the rest 2022-10-25 08:58:40 -06:00
Jeremy Soller
564dab009c Relicense MIT OR Apache 2.0 2022-10-24 12:58:15 -06:00
Jeremy Soller
50dfd4e6ed
Performance improvements 2022-10-21 12:31:02 -06:00
Jeremy Soller
441112b5e2
More implementation of new buffer abstraction 2022-10-20 19:34:56 -06:00
Jeremy Soller
0cbc3c3cfa
Allow buffer text to be reset 2022-10-19 13:15:07 -06:00
Jeremy Soller
edc0631df6
Fix control character usage 2022-10-19 11:33:35 -06:00
Jeremy Soller
c29eed3a94
Implement Home/End 2022-10-19 11:08:15 -06:00
Jeremy Soller
190b41f387
Add selection 2022-10-19 10:12:52 -06:00
Jeremy Soller
405c77bb47
More documentation 2022-10-19 08:34:34 -06:00
Jeremy Soller
021782b92b
Move drawing and hit detection to buffer 2022-10-19 07:36:27 -06:00
Jeremy Soller
a242d817e9
Add documentation and improve API 2022-10-18 17:14:03 -06:00
Jeremy Soller
de572b1645
New TextMetrics type 2022-10-18 17:14:03 -06:00
Jeremy Soller
2f6a9d33d1
Move all scroll handling to buffer 2022-10-18 13:20:13 -06:00
Jeremy Soller
a21225c9a0
Use mutex for TextBuffer state 2022-10-18 13:12:25 -06:00
Jeremy Soller
3e04ffdfa4
Handle scroll in TextBuffer 2022-10-18 12:42:37 -06:00
Jeremy Soller
410d4ee674
Text library moved from libcosmic 2022-10-18 12:07:22 -06:00