Comments (9)
Pattern where capacity == 0 (aka the useless pattern)
The hidden()
method should hide all characters, rather than hiding none. It behaves like this because the reduction function looks for the first placeholder characters, does not find one, then stops at the end index (meaning that the effect is the same as the first placeholder being the end index, which is false). Solving this should also remove the need for special case selection on 100% formatting.
A solution has been introduced in 2be0c99
from diffabletextviews.
Apparently, I forgot to override Snapshot/distance(from:to:)
so it’s still O(n).
Added in: d7dd5b5. If you look at Collection and BidirectionalCollection, you will find that a custom implementation of distance(from:to:)
is enough to override both count
and underestimatedCount
, and that the isEmpty
default is OK.
from diffabletextviews.
Lazy views improve readability
It’s easier to reason about the complexity of code when laziness is explicit. So I think it would be better if snapshot.nonvirtuals
were instead snapshot.lazy.nonvirtuals()
. With two extensions, you could write:
snapshot.nonvirtuals()
snapshot.lazy.nonvirtuals()
A follow up to this (and an actual improvement) would be adding a Proposal.Lazy
:
proposal.merged().nonvirtuals()
proposal.lazy.merged().nonvirtuals() // this option does not yet exist
Added in: e4708c9. It removes an O(n) operation in both NumberTextStyle/resolve(_:)
and PatternTextStyle/resolve(_:)
because neither of them needed to actually merge the proposal for any other reason than to access Snapshot/nonvirtuals
.
from diffabletextviews.
I think that PatternTextStyle/resolve
can use the same reduce function as format
and interpret
. At least it looked like it before Xcode 14.0 beta 5 decided to piviot its career to that of a pyromaniac. Anyways, it would be more performant and less code to maintain.
PatternTextStyle/resolve(_:with:)
now uses the reduce method directly, ba6f11c.
from diffabletextviews.
Fixed a bug in 5940f6b where localizable styles marked as equals(())
would not be localized on setup (input shadowed output). It’s not that note worthy, because the bug had not been introduced outside of beta.
from diffabletextviews.
Removed Lock
in cfa97c6 because it was made obsolete by #161
from diffabletextviews.
Cleaned up debug messages in ac76804 as:
[DiffableTextViews] [context]: [message]
from diffabletextviews.
Fixed #161 suggestion
+ autocorrection
+ reentrance
selection flash in cb8eb65.
from diffabletextviews.
PatternTextStyle
: made state public.
PatternTextStyle
: added initializer parameters.
PatternTextPlaceholders
: made ExpressibleByDictionaryLiteral
.
from diffabletextviews.
Related Issues (20)
- Export `WrapperTextStyle` & `NullableTextStyle` HOT 1
- Add `Prefix`, `Suffix` and/or `Labels` wrappers HOT 3
- Rename `isolated()` modifier as `standalone()` HOT 1
- Replace `anchor` with `selection` HOT 2
- Improve `nil` + `prefix(_:)` & `suffix(_:)` interaction HOT 6
- Remove some wrapper conveniences HOT 1
- Add selection requirement on 100% formatting to `Commit` HOT 2
- Add a `NormalTextStyle` HOT 2
- `Proposal/base` should be a `SubSequence` HOT 1
- Move selection from `Snapshot` to `Commit` HOT 3
- SwiftUI vs Xcode 14.0 beta 5-6 HOT 3
- Parsing (U)Int(8-64) > max `String` crashes HOT 3
- Consider `@_spi` attribute HOT 1
- Support reentrant updates HOT 7
- Dismiss when active and upstream (value) input != output. HOT 2
- Add a simplistic toolbar option HOT 1
- Performance (?)
- `v5.0.0` (awaiting Xcode 14.0)
- Type 'DiffableTextStyle' has no member 'currency' HOT 2
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 diffabletextviews.