brackets-ruler
brackets-ruler copied to clipboard
Rulers don't work in splitview
Hey Lance, I tested your Column Ruler extension with splitview (Jeff/Splitview-factory) and it doesn't work as designed.
- primary ruler extends over secondary view
- no ruler for secondary view
You can test with the jeff/splitview-factory branch
Sounds good, I will look into it. Thanks for the heads up.
Pushed https://github.com/lkcampbell/brackets-ruler/commit/54d8b36c11118dad8e6905e6edf73a22f7a0d6a3.
Fixes the immediately broken ruler in the new Split View Architecture.
Ruler now functions correctly for single view mode and disappears for split view mode. Aside from a minor scrolling bug, the ruler functions in Sprint 44 Brackets without breaking it.
Multiple rulers in multiple views will be part of future functionality.
@JeffryBooher, I don't think I can do this without changing some core Brackets code:
- There needs to be a way to insert the ruler into the Pane object, between the
pane-header
and thepane-content
div (creation of a pane-footer and a way to insert in or near it might be useful in the future as well, but not necessary for me). - The Pane object needs to be able to update the height of pane-content correctly when the ruler is shown or hidden.
I can address number one right now by inserting into the DOM but it would probably be better to have an API to do this in the near future. I am assuming that extension developers may want to create and add Pane-specific headers and footers at some point.
Number two probably needs a core code change to work. I'm thinking an update to Pane.prototype._updateHeaderHeight()
to account for other siblings besides just pane-header
so the height is calculated correctly with the insertion of other divs.
What do you think?
Moved ruler out of pane for now. Waiting on an API to insert ruler into panes properly.
This fixes the last bug with the ruler in Sprint 44. It doesn't work in split view yet but it doesn't break either.
@JeffryBooher, any rough ideas of when the API to inject divs into the split pane header will be available?
+1 The ruler disappears once I go into 2 column view.
Not knowing that something like this already existed, I have written the Brackets Print Margin extension to add a column guide. I called the guide line "print margin" as in the Eclipse preferences though.
I don't have the ruler on top, but the line is also displayed in multiple editors in splitview by adding a background to .CodeMirror-lines
.
Maybe you could do something similar to at least display the guide in splitview.
@Hirse Thank you!
@Hirse, agreed. This extension has been a nightmare to maintain. I'm going to toss the entire ruler interface in the trash and just rewrite this extension with user preferences, basically a thin layer over the CodeMirror addon.