parent
0f191d54ee
commit
18a8ae2f28
|
@ -679,7 +679,7 @@ export function posFromMouse(cm, e, liberal, forRect) {
|
|||
try { x = e.clientX - space.left; y = e.clientY - space.top }
|
||||
catch (e) { return null }
|
||||
let coords = coordsChar(cm, x, y), line
|
||||
if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {
|
||||
if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {
|
||||
let colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length
|
||||
coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue