}
public virtual int CharAt (Context ic)
{
- return ic.preedit[Position (ic)];
+ int pos = Position (ic);
+
+ return ((pos >= 0 && pos < ic.preedit.Length) ? ic.preedit[pos]
+ : -1);
}
public override string ToString ()
public PredefinedSurround (MSymbol name) : base (name)
{
- if (! int.TryParse (((string) name).Substring (2), out distance))
+ if (! int.TryParse (((string) name).Substring (1), out distance))
throw new Exception ("Invalid marker name: " + name);
if (distance > 0)
distance--;
Xex.Term[] args)
{
return new Xex.Term (((Context) domain.context).GetSurroundingText == null
- ? 0 : 1);
+ ? -2 : -1);
}
public override string ToString ()
private bool handle_key ()
{
+ Console.WriteLine ("{0}:key='{1}'", state.name,
+ new MText (keys.keyseq[key_head].ToChar ()));
Keymap sub = keymap.Lookup (keys, ref key_head);
if (sub != keymap)