lexicalunit / multi-wrap-guide

Provides multiple draggable wrap guides.
MIT License
8 stars 0 forks source link

Cyclical horizontal guides #28

Open piranna opened 7 years ago

piranna commented 7 years ago

Allow someway to define about each how much lines horizonal guides should repeat. This would give some indication about printed pages, for example.

lexicalunit commented 7 years ago

Interesting idea! I think I could actually implement this pretty easily. I may give it a shot this weekend.

piranna commented 7 years ago

I'm thinking... maybe it would make sense to define the default horizontal cycle at 25 rows? This would allow to have by default a set of 80x25 characters as the traditional consoles... :-)

And once we are there, maybe it would make sense to add a vertical cycle too (disable by default, obivously). In both cases it would be used the highest value on the set of guides, similar to how the desired wrap guide is changed by this module, how do you see it?

lexicalunit commented 7 years ago

I thought maybe I could implement this in CSS/LESS somehow but I think the wrap guides will have to be actual DOM elements. Which makes repeating a little more difficult than I thought. We need to watch for when the editor scrolls and insert the guides as needed. Still doable just more work than I initially thought.

piranna commented 7 years ago

I agree it will need some Javascript, so far related to this I only know of the odd and even CSS functions, but I don't think it's needed DOM elements, it can be build with CSS classes and just assign them to the correct rows/columns, isn't it?

piranna commented 7 years ago

Oh my, it's possible with pure CSS!!! :-D

lexicalunit commented 7 years ago

I've been really sick with a lung infection for a while. Just now starting to heal. I think we may be able to leverage something like this https://github.com/atom/wrap-guide/issues/14#issuecomment-293047410 to resolve this issue.

piranna commented 7 years ago

I'm sorry to read that, luckily you are getting well now :-) Yes, for doing it using CSS we could follow that, maybe combined with the th thing.

piranna commented 7 years ago

Hi! Any update on this? :-)

lexicalunit commented 7 years ago

Thanks for the bump; I had forgot I was going to look into this. It's an interesting idea and I think I know how to implement it. There's a lot of work I need to do on multi-wrap-guide anyway. Atom has made a number of changes in the recent versions and I need to update my code a bit, move away from coffeescript in favor of ES6, and replace deprecated utilities like atom-space-pen-views with something more fancy like etch + React. All of those plus some refactoring should make adding features like this easier.

piranna commented 7 years ago

move away from coffeescript in favor of ES6

Hell yes! :-P