[Monodevelop-devel] Coordinate system refactoring

Mike Krüger mkrueger at novell.com
Fri Aug 20 14:26:35 EDT 2010


  Hi

Today I finished the coordinate system refactoring. I choose 1 based 
coordinates for the text editor. Then the text editor is more compatible 
with the coordinates used in monodevelop.

The main reason I choose the 1 based coordinates for lines/colums is 
that I get 1 based coordinates at all inputs and I need to output 1 
based coordinates to the user. Therefore it doesn't make any real sense 
to use 0 based coordinates for lines/columns. Most other editors I 
looked at seem to use 1 based coordinates too - therefore it's the 
'standard' coordinate system.

All tests are green - but I expect some bugs - I  try to cover anything 
with unit tests. I'll test it a few days, when I think it's stable I 
submit it next week. I mainly did the change because the coordinate 
transformation is a cause of hard to find errors and makes the code less 
readable. I hope that I can work on the refactoring/code completion 
stuff after we finished the version control gui - for refactoring it's a 
nightmare to have to transform all the coordinates everytime because 
I've to access the parser coordinates and the text editor coordinas 
everywhere.

btw. I've put 2 constants in the document location struct : MinLine and 
MinColumn for everyone who doesn't want to check against 1 or 0.

Regards
Mike


More information about the Monodevelop-devel-list mailing list