Comments (1)
I implemented Option 1 as it was fairly straightforward, but saving/resume the internal state wasn't the issue as far as my implementation went: I've resolved that now. (It turns out there is some nuance with BufferLine
's AttrsList::spans
that I wasn't aware of. I think this could benefit from some documentation, so I'll submit a PR for that.)
Cursor
and Selection
(which are already accessible) is possibly enough state to save.
However, I still think these ideas of saving/resuming editor state, or mutating external state in response to editor actions, could be generally useful though, especially when something else owns the buffer, but I don't have a clear suggestion of what that API or implementation looks like.
Another option here is to make all Editor
/Edit
methods take a &mut Buffer
as a parameter, and have a BorrowedWithBuffer
helper, in the same way we made the split between Buffer
and FontSystem
and have BorrowedWithFontSystem
.
from cosmic-text.
Related Issues (20)
- Font Fallback Regression with Thaana script HOT 2
- `cosmic-text` tests: "No default font found" HOT 1
- Is there any way to disable hinting and anti-aliasing?
- Make reshaping/relayouting when inputs change lazy
- line_y < 0.0 in LayoutRunIter for certain fonts HOT 5
- Full support for fontconfig
- Editor Clone HOT 1
- "Failed to load font 'bootstrap-icons'" regression HOT 2
- A number of MacOS fonts fail to render since 0.12.0 HOT 11
- Arabic words must never be split by line breaking. HOT 1
- Buffer is lossy / loses source information
- Bidi behavior of `set_text()` vs. `set_rich_text()`
- how to use input method in cosmic-text editor?
- Shortcuts like CTRL + Backspace HOT 2
- emoji picker
- Efficiency of Buffer::set_rich_text
- Can I use `set_tab_width` without passing a `&mut FontSystem`.
- Performance improvements
- Emoji rendering with NotoColorEmoji yields an empty image HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cosmic-text.