lkcampbell / brackets-ruler

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

Multiple guides #35

Open ghost opened 10 years ago

ghost commented 10 years ago

Having multiple guides would be helpful. I try to use Brackets in almost all web projects now. But not in all projects we have set the line length to 80 columns in our dev guides.

I suggest an array of guides like it is in Sublime Text 2/3

I don't know if its a good idea to allow different styles per guide or if all guides should use same style, color and thickness.

lkcampbell commented 10 years ago

@fibric, do you mean showing more than one guide at a time in the editor? I do have a copy of Sublime 3 but I'm not familiar with all the different features, can you tell me the steps to take to activate this feature in Sublime so I can see an example?

ghost commented 10 years ago

@lkcampbell find your (settings user) preference file. you should have an array called rulers in this file. if not you can add this.

"rulers":
    [
        70,
        78,
        80,
        100,
        120
    ],

Here is how it looks (added orange arrows by myself) 2014-05-22_16-01-10

lkcampbell commented 10 years ago

@fibric, ok, so, yes, multiple rulers in a single editor. The data model isn't a problem since this extension uses the CodeMirror rulers addon, and it is already defined in terms of an array of ruler objects. It would, however, complicate the Extension Preferences a bit by changing them from single object properties to an array of ruler objects. Probably could still interpret simple extension properties as a single ruler though.

Also, the ruler User Interface would have to change. A click would create a new ruler every time. Clicking on an existing ruler would still toggle it on or off. A click drag on an existing ruler could still reposition it.

I wonder if it would be better as a preference since not everyone would necessary want this more advanced behavior. At any rate, I need to think on it a bit

ghost commented 10 years ago

@lkcampbell I didn't know about click/doubleclick on ruler/bar can hide/unhide a ruler. It's btw a good behavior, I like this.

As it sounds to me, a new ruler life cycle is need to allow more than 1 ruler at a time.

Or turn off click behavior by configuration. Force users to decide between having multiple rulers or having click behavior for just 1 ruler.

lkcampbell commented 7 years ago

@fibric, I'm going to be rewriting this extension from scratch soon, tossing out the ruler interface, and allowing multiple guides via Preferences. Stayed tuned for version 3.0.