Roman Hubacek, 02.05.2006 14:31:
    ...
    local pos = editor.CurrentPos
    local nextchar = "\n"
    if pos<editor.Length then
      nextchar = editor:textrange(pos, pos+1)
    end

    if ((nextchar == "\n") or (nextchar == "\r")) then
    ...

-- Roman

Thank you for your help,
i changed it a bit to enable completition also in brackets (e.g. [''])...

  local toClose = { ['('] = ')', ['['] = ']', ['{'] = '}', ['"'] = '"',
["'"] = "'" }
  local allowedChars = { [')']=1, [']'] = 1, ['}'] = 1, ['\n'] = 1,
['\r'] = 1 }
  if (toClose[c]) then
    local pos = editor.CurrentPos
    local nextchar = "\n"
    if pos<editor.Length then
       nextchar = editor:textrange(pos, pos+1)
    end
    if (allowedChars[nextchar] == 1) then
      editor:SetSel(pos,pos)
      editor:ReplaceSel(toClose[c])
      editor:SetSel(pos,pos)
    end
  end


Frank

_______________________________________________
Scite-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scite-interest

Reply via email to