thehogfather / brackets-code-folding

Code folding extension for brackets IDE
134 stars 42 forks source link

Collision with css color preview plugin #103

Closed cmgddd closed 9 years ago

cmgddd commented 9 years ago

I'm not sure the real reason for this problem. please help to check, tks. https://github.com/cmgddd/Brackets-css-color-preview/issues/2

zergius-eggstream commented 9 years ago

It seems this commit didn't fix a problem. I had to monkeypatch main.js with code cm.setOption("gutters", ["CodeMirror-colorGutter","CodeMirror-linenumbers","CodeMirror-foldgutter"]);

thehogfather commented 9 years ago

@zergius-eggstream the patch @09bf5d3 fixes it. It is not a good idea to overwrite the gutter elements with absolute values - better to insert the gutter element into the existing gutters array.

However there seems to be a catch! You need to call cm.setOption("gutters") with a new array (and not the original array returned by cm.getOptions("gutters") - or a modified version of it). Hence the use of cm.getOption("gutters").slice(0). This is a shortcut for creating a copy of the gutters array.

So currently the problem is in the brackets-css-color-preview plugin. I submitted a PR that was merged. The change seems to have been overwritted by @cmgddd (probably inadvertently).

zergius-eggstream commented 9 years ago

I see

cmgddd commented 9 years ago

hmm, already added back. it's my fault