mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
Do not set cursor to the right of newline with mouse
When a row is broken by for example a display math inset, it is
possible to put the cursor at the end of the previous line using the
boundary setting of cursor.
For newline insets and separator insets, we want to force the cursor
to be before this inset. Also, in the other cases, do not force
boundary property (effectively reverts part of f29e7803
).
This commit is contained in:
parent
fdab91be63
commit
3b6919217b
@ -1156,9 +1156,14 @@ pos_type TextMetrics::getPosNearX(Row const & row, int & x,
|
||||
* row is larger than the end of its last element.
|
||||
*/
|
||||
if (!row.empty() && pos == row.back().endpos
|
||||
&& row.back().endpos == row.endpos())
|
||||
boundary = true;
|
||||
|
||||
&& row.back().endpos == row.endpos()) {
|
||||
Inset const * inset = row.back().inset;
|
||||
if (inset && (inset->lyxCode() == NEWLINE_CODE
|
||||
|| inset->lyxCode() == SEPARATOR_CODE))
|
||||
pos = row.back().pos;
|
||||
else
|
||||
boundary = row.right_boundary();
|
||||
}
|
||||
x += xo;
|
||||
//LYXERR0("getPosNearX ==> pos=" << pos << ", boundary=" << boundary);
|
||||
return pos;
|
||||
|
Loading…
Reference in New Issue
Block a user