[MonoDevelop] Text Cursor positioning in Monodevelop v2 beta 1

Tom Spink tspink at gmail.com
Thu Feb 26 10:34:41 EST 2009


2009/2/26 Zachary Richmond <dev.ihsdoor at gmail.com>:
> Bump.  Yes I am having this problem too on openSUSE 11.1  It is making
> me want to revert back to Alpha 2, but the 3.5 project support is nice
> (among many other things).

I was having a poke around (as I'm also experiencing this), and it
seems to be an issue in:

  addins/Mono.Texteditor/Mono.TextEditor/TextViewMargin.cs

Specifically, the VisualLocationTranslator class - it's either an
off-by-one error (which I can't immediately pick up on, because the
code is quite complex), or it needs to be made a bit more clever in
detecting when the position being looked up lies in the middle of a
character.  A quick hack was to change line 1267 to this:

  return new DocumentLocation (lineNumber, column - 1);

BUT, this IS NOT the correct fix - it simply disguises the issue (i.e.
gives you almost the expected behaviour) but it also introduces a bug
that stops you being able to select the last character on a line.
Clearly, if it's an off-by-one error, it's elsewhere in the class when
the column index is being calculated; but I see lots of complicated
calculations that will require further study.

Probably someone with a lot more knowledge than me about this class
should delve into it and take a look...

Hope this helps,
-- 
Tom Spink
Rodney Dangerfield  - "When I was a kid my parents moved a lot, but I
always found them."


More information about the Monodevelop-list mailing list