@PeterJones said in Hide horizontal line at folds?:
editor.setElementColour(ELEMENT.FOLD_LINE, (0,0,255,255))
where the color is (RED,GREEN,BLUE,ALPHA)
…
And hiding it completely can be done by either setting the ALPHA to 0
Yes, surprisingly this works.
While:
or editor.setFoldFlags(0) in PythonScript
no, not by itself: it would leave behind a green line as if text were hidden with View/Hide Lines . As the other thread showed, that command would need to be followed by additional commands to set the Alpha of those “hidden lines’line” to 0. The full equivalent in Python would be:
editor.setFoldFlags(0)
old_col=editor.getElementColour(ELEMENT.HIDDEN_LINE )
new_col=old_col[:3]+(0,) # 0 for alpha, to hide; 255 to show
editor.setElementColour(ELEMENT.HIDDEN_LINE, new_col)
I find it puzzling that the latter solution requires further changing the "hidden lines’ line " colour, while:
editor.setElementColour(ELEMENT.FOLD_LINE, (x,x,x,0))
is enough by itself.
At first I thought it’s a PythonScript behind the scenes trick, but it works in NppExec too, for example with:
SCI_SENDMSG SCI_SETELEMENTCOLOUR SC_ELEMENT_FOLD_LINE 0x00000000
(the relevant Alpha part is the first 2 0s , making color transparent/invisible).