1

The following code I use sets a Scintilla window for folding:

local SCI_STYLECLEARALL = 2050
local SCI_SETMARGINMASKN = 2244
local SCI_SETMARGINSENSITIVEN = 2246
local SCI_STYLESETFORE = 2051
local SCI_MARKERDEFINE = 2040
local SC_MARKNUM_FOLDEROPEN = 31
local SC_MARK_BOXMINUS = 14
local SC_MARKNUM_FOLDER = 30
local SC_MARK_BOXPLUS = 12
local SC_MARKNUM_FOLDERSUB = 29
local SC_MARK_VLINE = 9
local SC_MARKNUM_FOLDERTAIL = 28
local SC_MARK_LCORNERCURVE = 16
local SCI_MARKERSETFORE = 2041
local SCI_MARKERSETBACK = 2042
local SCI_SETFOLDMARGINCOLOUR = 2290
local SCI_USEPOPUP = 2371
local SCI_SETMARGINWIDTHN = 2242
local SCI_STYLESETSIZE = 2055
Scintilla.SendMessage(Ctrl,SCI_STYLECLEARALL,0,0)
Scintilla.SendMessage(Ctrl,SCI_SETMARGINWIDTHN,1,0)
Scintilla.SendMessage(Ctrl,SCI_SETMARGINSENSITIVEN,2,1)
Scintilla.SendMessage(Ctrl,SCI_SETMARGINMASKN,2,-33554432)
Scintilla.SendMessage(Ctrl,SCI_STYLESETFORE,32,12632256)
Scintilla.SendMessage(Ctrl,SCI_MARKERDEFINE,SC_MARKNUM_FOLDEROPEN,SC_MARK_BOXMINUS)
Scintilla.SendMessage(Ctrl,SCI_MARKERDEFINE,SC_MARKNUM_FOLDER,SC_MARK_BOXPLUS)
Scintilla.SendMessage(Ctrl,SCI_MARKERDEFINE,SC_MARKNUM_FOLDERSUB,SC_MARK_VLINE)
Scintilla.SendMessage(Ctrl,SCI_MARKERDEFINE,SC_MARKNUM_FOLDERTAIL,SC_MARK_LCORNERCURVE)
Scintilla.SendMessage(Ctrl,SCI_MARKERSETFORE,SC_MARKNUM_FOLDER,12632256)
Scintilla.SendMessage(Ctrl,SCI_MARKERSETBACK,SC_MARKNUM_FOLDER,16777215)
Scintilla.SendMessage(Ctrl,SCI_MARKERSETFORE,SC_MARKNUM_FOLDEROPEN,12632256)
Scintilla.SendMessage(Ctrl,SCI_MARKERSETBACK,SC_MARKNUM_FOLDEROPEN,16777215)
Scintilla.SendMessage(Ctrl,SCI_MARKERSETBACK,SC_MARKNUM_FOLDERSUB,12632256)
Scintilla.SendMessage(Ctrl,SCI_MARKERSETBACK,SC_MARKNUM_FOLDERTAIL,12632256)
Scintilla.SendMessage(Ctrl,SCI_SETMARGINWIDTHN,2,20)
Scintilla.SendMessage(Ctrl,SCI_USEPOPUP,0,0)
Scintilla.SendMessage(Ctrl,SCI_SETFOLDMARGINCOLOUR,1,16777215)
Scintilla.SendMessage(Ctrl,SCI_STYLESETSIZE,32,10)

but for whatever reason the default circle icon for the fold open/close does not get overwritten by the new value so the circle shows below the new selection:

enter image description here

have tried SCI_MARKERDELETEALL and SCI_MARKERDELETE to try to remove the default icon before applying the new one but it has no effect, how do I get rid of the offending circle?

The square is the default Scintilla image and according to the docs it should not look like that (Box +, Box -):

enter image description here

Col_Blimp
  • 779
  • 2
  • 8
  • 26
  • I don't see the circle you are referring to. Can you mark it on the screenshot? – Paul Kulchenko May 20 '14 at 17:59
  • Hi Paul, changed the picture, its the black line at the top and to the left of the selection square, I thought it was the default circle but maybe not now its enlarged but anyway how do I get rid of it? – Col_Blimp May 20 '14 at 18:16
  • I have never seen these artifacts before (and I've been using Scintilla components on Windows, OSX, and Linux for several years). I suggest you remove everything that is not relevant to the folding markers and from those you only leave the one that has the artifact. It will help you figure out if it's a drawing issue or some other marker that overlaps with it. I'd also suggest to disable double buffering (SCI_SETBUFFEREDDRAW) while you are investigating this. – Paul Kulchenko May 20 '14 at 18:50
  • Well SCI_SETBUFFEREDDRAW has no effect and creating a blank document and only setting line 0 to have the square does the same thing, it does not seem to matter what SC_MARKNUM_FOLDEROPEN is set to as these black lines appear but they do not show if SC_MARKNUM_FOLDEROPEN is not set then just the default circle shows. – Col_Blimp May 20 '14 at 19:15
  • Hm, what platform are you running this on and what version of Scintilla? I've been using 3.2.1, but have also tested with 3.3.9 and didn't see any issues with folding markers. I have several screenshots on [my blog](http://notebook.kulchenko.com/). – Paul Kulchenko May 21 '14 at 00:35
  • Hi, it's 3.4.1 on Windows, playing about with it then it would seem that SCI_MARKERDEFINE on fold open/close fails to delete the default circle before adding in the desired icon, reported this on the Scintilla bug thing and he says there have been reports of 'image persistence' but I found an old dll v1.6.7 and I get the same behavior its odd because SCI_MARKERDEFINE works just fine setting the SC_MARKNUM_FOLDERSUB and SC_MARKNUM_FOLDERTAIL. Tried it with margin 3 and 4 but get the same result. – Col_Blimp May 21 '14 at 04:07
  • Do you also see the same effect in SciTE of the same version? – Paul Kulchenko May 21 '14 at 16:19
  • Hi Paul, turns out I needed to set SC_MARKNUM_FOLDEREND, SC_MARKNUM_FOLDEROPENMID and SC_MARKNUM_FOLDERMIDTAIL to one of the symbols, thanks for your time. – Col_Blimp May 21 '14 at 16:35
  • Add this as the answer and accept it. Basically, it appears you need to set all folder markers for them to be drawn properly. – Paul Kulchenko May 22 '14 at 02:59

1 Answers1

0

You need to set all folder markers for them to be drawn properly.

Col_Blimp
  • 779
  • 2
  • 8
  • 26