lkcampbell / brackets-ruler

An extension for Brackets that adds an adjustable column ruler to the editor.
17 stars 10 forks source link

Rulers don't work in splitview #37

Open JeffryBooher opened 10 years ago

JeffryBooher commented 10 years ago

Hey Lance, I tested your Column Ruler extension with splitview (Jeff/Splitview-factory) and it doesn't work as designed.

1) primary ruler extends over secondary view 2) no ruler for secondary view

You can test with the jeff/splitview-factory branch

lkcampbell commented 10 years ago

Sounds good, I will look into it. Thanks for the heads up.

lkcampbell commented 10 years ago

Pushed https://github.com/lkcampbell/brackets-ruler/commit/54d8b36c11118dad8e6905e6edf73a22f7a0d6a3.

Fixes the immediately broken ruler in the new Split View Architecture.

lkcampbell commented 10 years ago

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.

lkcampbell commented 10 years ago

@JeffryBooher, I don't think I can do this without changing some core Brackets code:

  1. There needs to be a way to insert the ruler into the Pane object, between the pane-header and the pane-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).
  2. 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?

lkcampbell commented 10 years ago

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.

lkcampbell commented 9 years ago

@JeffryBooher, any rough ideas of when the API to inject divs into the split pane header will be available?

demisx commented 9 years ago

+1 The ruler disappears once I go into 2 column view.

Hirse commented 9 years ago

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.

GAZ082 commented 9 years ago

@Hirse Thank you!

lkcampbell commented 7 years ago

@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.