Comments (8)
Duplicate of #8
from rulerz.
Not really ...
But I guess the net effect is similar : atom/atom#7204
I raised the issue on Atom also as it affects a few packages on 208 (while 207 is fine)
from rulerz.
@JohnMurga looks like you're right, these are distinct-but-related changes that happened in quick succession.
from rulerz.
Going to investigate using Markers instead of relying on manipulating layers in the editor directly.
from rulerz.
I got a response that may be useful ...
atom/atom#7204 (comment)
from rulerz.
Good call, @JohnMurga. Inserting into the shadowRoot gets it closer, but still having issues. First, the ruler gets thrown off horizontally by e.g. having line numbers enabled, and second, when the ruler is positioned correctly, it overlays the cursor so you don't see the blink effect.
Opacity could be a solution to the latter but it's probably not worth thinking too hard about before we figure out if adding a custom element to the shadowRoot is even the right way to move forward. Considered using Markers instead of "manual" DOM manipulation - thoughts anyone?
from rulerz.
Another idea entirely is to replace all of the JS code with a pure-CSS solution. The following is a rough draft:
atom-text-editor.is-focused::shadow {
.cursors {
.cursor::before {
content: " ";
display: block;
height: 100%;
width: 1px;
transform: translateX(-0px) scaleY(1000);
border-left: 1px solid @text-color-subtle;
overflow: hidden;
}
}
}
Two problems with this approach though:
- The ruler blinks with the cursor (and since .cursors.blink-off uses
opacity
instead ofrgba
, I don't see a clean way around this) - Using
translateX(-1px)
to align the ruler perfectly with the cusor, hides the cursor (even when setting a negativez-index
to try to force the ruler "behind" the cursor)
from rulerz.
Instead of appending the Element to the old underlayer, it is now appended to the .lines
div within the ShadowRoot of the editor. If this isn't best practice, someone holler - this editor moves too damn fast for me to keep up with standards sometimes, especially in the face of all this 1.0 deprecation ;-)
from rulerz.
Related Issues (20)
- Uncaught TypeError: Cannot read property 'appendChild' of null HOT 2
- some advise about rulerz HOT 1
- Enhancement: Disable rulerz for first character in line HOT 9
- The ruler line only shows up on 1 of N split panes HOT 1
- toggle the ruler by hotkey HOT 1
- The ruler line falls behind the cursor HOT 7
- atom-text-editor.Object.defineProperty.get is deprecated. HOT 4
- Deprecated selector in `rulerz/styles/cursor-ruler.less` HOT 3
- Add rulerz to vsCode? HOT 3
- Vertical ruler gets translated when scrolling editor horizontally HOT 3
- Failed to activate the rulerz package HOT 6
- Ruler not appearing when opening new tab since 1.19.0 release HOT 2
- Open to taking over maintenance HOT 4
- Leading Tabs Throw Off Ruler HOT 2
- Kudos ! HOT 2
- Use the `atom-pane` tag instead of the `pane` class.
- Add keywords to package.json
- TextEditor.pixelPositionForScreenPosition is deprecated. HOT 1
- Failed to activate the rulerz package HOT 8
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 rulerz.