brackets-ruler icon indicating copy to clipboard operation
brackets-ruler copied to clipboard

Rulers don't work in splitview

Open JeffryBooher opened this issue 10 years ago • 10 comments

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

JeffryBooher avatar Aug 21 '14 00:08 JeffryBooher

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

lkcampbell avatar Aug 21 '14 00:08 lkcampbell

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

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

lkcampbell avatar Sep 05 '14 18:09 lkcampbell

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 avatar Sep 07 '14 18:09 lkcampbell

@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 avatar Sep 14 '14 16:09 lkcampbell

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 avatar Sep 15 '14 12:09 lkcampbell

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

lkcampbell avatar Oct 03 '14 14:10 lkcampbell

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

demisx avatar Jan 29 '15 21:01 demisx

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 avatar Mar 01 '15 22:03 Hirse

@Hirse Thank you!

GAZ082 avatar Mar 04 '15 23:03 GAZ082

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

lkcampbell avatar Apr 11 '17 23:04 lkcampbell