Hello, Neil,
Could you, please, assist to understand few moments related to Indicators?
Basically I have 4 questions.
Question 1. Indicators are mentioned on “Using Lua With Scite” page. (http://lua-users.org/wiki/UsingLuaWithScite).
There are 2 examples how to use it. One example is based on three command sequence:
editor:StartStyling(pos,INDICS_MASK)
editor:SetStyling(len,INDIC0_MASK + ind)
editor:SetStyling(2,31)
(“ind” value could be:
0 green squiggly line
1 light blue line of small T shapes
2 light red line)
However, when I try using these commands usually I don’t see any effect. Sometimes, the text between pos and pos+len is highlighted in gray. I assume it could relate to some property value.
There is another example on this page:
“Indicators with version 1.70 and maybe previous. And you can use it like this :
editor:StartStyling(editor.SelectionStart,INDICS_MASK)
editor:SetStyling(string.len(editor:GetSelText()),flag)”
But, it also doesn’t work for me.
Does SciTe still support above methods? What is wrong here?
Question 2. I found another method in “Scite Mark Word” macro.
(http://lua-users.org/wiki/SciteMarkWord ).
The author used the following commands.
scite.SendEditor(SCI_INDICSETSTYLE, 0, INDIC_ROUNDBOX)
scite.SendEditor(SCI_INDICSETFORE, 0, 255)
scite.SendEditor(SCI_INDICATORFILLRANGE, a, b)
However, it looks like SCI_INDICSETSTYLE and SCI_INDICSETFORE don’t have any effect.
When SCI_INDICATORFILLRANGE is applied the specified text is underlined.
Does scite still support SCI_INDICSETSTYLE and SCI_INDICSETFORE?
Question 3. I realized that indicators applied using SCI_INDICATORFILLRANGE.are controlled by SCI_SETINDICATORCURRENT. The command is scite.SendEditor(SCI_SETINDICATORCURRENT, n) . Default value of n(when scite starts) is 9. ( scite.SendEditor(SCI_GETINDICATORCURRENT) returns current value). Then I found the following:
If n=0, text is coloured in green.
If n=1, text is coloured in blue.
If n=2, text is coloured in red.
If n is between 3 and 13. text is underlined. I didn’t test values greater than n=13.
I also found some differences in the following indicator behavior.
If N=9 (the default value) tab switch removes indicators.
If N is between 0 and 7, tab switch doesn't remove indicators, but language switch via Language menu removes indicators.
If N=8 or N is between 10 and 13, neither tab switch nor language switch remove indicators.
So, I would like to confirm if it is a supported or unsupported behavior.
Question 4 is not directly related to indicators as I believe. When I was testing indicators on Windows I noticed some weird phenomenon. Once when SCI_SETINDICATORCURRENT was set to 9 the text was highlighted in yellow and not underlined. I believe it was some kind of glitch. The strange thing was that when I opened another scite windows and set SCI_SETINDICATORCURRENT to 9 the text was still highlighted in yellow. Then I closed all windows except the first and open again new windows. The text was still highlighted in yellow. And only after I closed all windows the indicator behavior was restored and in newly opened windows the text was again underlined. I even don’t try to interpret the nature of this glitch. My question is different. I understand that each scite window is an independent Windows process. How was it possible that a glitch that happened in one process could be spread across other independent Windows processes?
Thank you,
Yury