Frank Wunderlich:
ok, i see the error must in this function:

function OnChar(c)
  function char_at(p)
    return string.char(editor.CharAt[p])
  end
  local toClose = { ['('] = ')', ['['] = ']', ['"'] = '"', ["'"] = "'" }

  if (toClose[c] ~= nil) then
    local pos = editor.CurrentPos
    local nextchar=char_at(pos+1)
    if ((nextchar == "\n") or (nextchar == "\r")) then
      editor:ReplaceSel(toClose[c])
      editor:SetSel(pos, pos)
    end
  end
  return false
end


Hello, this works for me:

function OnChar(c)
  local toClose = { ['('] = ')', ['['] = ']', ['"'] = '"', ["'"] = "'" }
  if(toClose[c]) then
    local pos = editor.CurrentPos
    editor:SetSel(pos,pos)
    editor:ReplaceSel(toClose[c])
    editor:SetSel(pos,pos)
  end
end

-- Roman

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

Reply via email to