Hi,
Quote from your code:
ed.SetMarginType(1, stc.STC_MARGIN_SYMBOL)
ed.SetMarginWidth(1, 16)
ed.MarkerDefine(1, stc.STC_MARK_VLINE, '#ffff00', '#ffff00') # yellow
ed.SetMarginType(2, stc.STC_MARGIN_SYMBOL)
ed.SetMarginWidth(2, 16)
ed.MarkerDefine(2, stc.STC_MARK_BOOKMARK, '#ff00ff', '#ff00ff') # magenta
Firstly, MarkerDefine arg 1 is not a margin number but a marker number. So, what you are doing above is the definition that Marker number # 1 is VLINE, # 2 is BOOKMARK, and so on.
Next, you have to set a margin mask to select what marker should be displayed. You can check the current mask by GetMarginMask, and the result will be
>>> ed.GetMarginMask(1)
33554431
>>> ed.GetMarginMask(2)
0
The mask of margin=1 default is 0x1fffffff (=~stc.STC_MASK_FOLDERS), but margin=2 is 0
Therefore, both markers are displayed in the margin=1 but no markers in the margin=2.
If you want to let margin=1 show marker=1 only and margin=2 show marker=2 only, set each bitmask as,
ed.SetMarginMask(1, 1<<1)
ed.SetMarginMask(2, 1<<2)
good luck