Neil Hodgson wrote:
Is there any solution using LUA to solve this issue?
How do I know in which style is the cursor?

   editor.StyleAt[editor.CurrentPos]
   The caret is actually between two characters so that is the style
of the character after the caret.

Thanks Neil. I've wrote a code in lua and I've put it into function OnChar(ch):

if ch=='\n' then
    if props['FileExt']=="php" or props['FileExt']=="html" then
        if editor.StyleAt[editor.CurrentPos] < 117 then
            props['tabsize']=2
            props['indent.size']=2
            print("html tabsize="..props['tabsize'].." 
indentsize="..props['indent.size'])
        else
            print("php tabsize="..props['tabsize'].." 
indentsize="..props['indent.size'])
        end
    end
end

In the global option file I've set as default tabsize=4 and indend size=4.
The lua recognize the style, but doesn't make any effect to the editor. It 
shows in the
output the new value of tabsize (2) and indent size (2), but unfortunatelly
doesn't apply to the editor and the tabsize and indent size remain 4 (default).

Any ideas or anything I could check?

Thanks,
Istvan
_______________________________________________
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest

Reply via email to