From c1ac550c60517389b34bbfdaafa013d0cacb1f81 Mon Sep 17 00:00:00 2001 From: echicken <> Date: Wed, 6 May 2020 02:55:40 +0000 Subject: [PATCH] If it was a left click, return an object. Currently this only has a 'line' property, being which line from the source document was clicked. It may later become useful to report which position in the original string was clicked, or what word, etc. --- exec/load/scrollbox.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/exec/load/scrollbox.js b/exec/load/scrollbox.js index b7c0620a28..de10d8bc1c 100644 --- a/exec/load/scrollbox.js +++ b/exec/load/scrollbox.js @@ -168,7 +168,9 @@ ScrollBox.prototype.getcmd = function (c) { if (c.mouse && c.mouse.press && c.mouse.y >= this.y1 && c.mouse.y <= this.y2) { if (c.mouse.button == 64) return this.getcmd({ key: KEY_UP, mouse: null }); if (c.mouse.button == 65) return this.getcmd({ key: KEY_DOWN, mouse: null }); - if (c.mouse.button == 0) return this.line_map[c.mouse.y + this.y - this.y1]; + if (c.mouse.button == 0) { + return { line: this.line_map[c.mouse.y + this.y - this.y1] }; + } return true; } if (c.key == KEY_UP) { -- GitLab