atom-archive / text-document Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
When we create two adjacent markers and insert text between them, that extends both markers and makes them overlap.
For example, given a buffer
{abc}|{efg}
(where {}
denote a marker and |
denotes a cursor),
entering d
results in
{abc{d|}efg}
with both markers now containing the d
character.
I think this is due to the initial situation being indistinguishable from (and being handled as)
{abd{|}def}
in which the markers already overlap, just with no text in between them.
One way to encounter this situation is when expanding a snippet with adjacent placeholders like (in snippet syntax)
${1:one}${2:two}
Replacing one
with ab
, say, results in these intermediate states (in the notation above):
{a|}{two}
{a{b|}two}
which means jumping to the second tab stop would mark the b
we just entered at the first tab stop.
I can see that there's no obvious "correct" approach to take here, so maybe this behaviour is fine? It seems like restriction on the capability of snippets though.
One idea that I've had for "the perfect editor" (which is now Atom in my mind) is the ability to decouple storage format from display format. Whether for just making code easier to read on screens of differing sizes (or for people with differing visual acuity) or finally getting us to the point where these decades-old debates over tabs vs. spaces and line length finally go away, I think this feature could make Atom really amazing:
https://discuss.atom.io/t/decoupling-display-format-from-storage-format/7245
If I'm understanding the approach correctly, I think this library is where these kinds of hooks would fit and I wanted to raise this idea while this subsystem is being designed/refactored.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.