Am 23.05.2007 um 17:08 schrieb Abdelrazak Younes:
Stefan Schimanski wrote:Hi!My cursor often skips lines when moving downwards. I was trying to understand the code and found this in Text2.cpp:// To middle of next row int const margin = 3 * InsetMathHull::displayMargin() / 2; editXY(cur, x, y + pm.rows()[row].descent() + margin);What is the reasoning here? Why do we take the margin of a math hull in general text cursor handling? Isn't the row descent() enough? Moreover is there a need to have Text::cursorDown and Text::cursorUp sharing 95% of it's code?Stefan P.S.: Strangely moving upwards is fine.Bennett said the opposite in bugzilla:One further note: in current svn (18281), uparrow also skips lines in the same way.
I removed the margin now completely and substract 1 in the cursorUp case. This works fine everywhere but the display math. In display math (i.e. a InsetMathHull) the cursor up/down keys are not handled properly. Instead Cursor::bruteFind is used to find the nearest inset. Unfortunately bruteFind uses the pure geometrical distance as a measure to find the nearest inset. This is not what one expects from cursorUp/Down because one only want a nearest inset in the row above. I am currently looking into this....
Stefan
PGP.sig
Description: Signierter Teil der Nachricht