rxi / lite

A lightweight text editor written in Lua
MIT License
7.42k stars 353 forks source link

[bug] DocView.on_mouse_released() gets called twice #312

Open SwissalpS opened 1 year ago

SwissalpS commented 1 year ago

to reproduce:

local omr = DocView.on_mouse_released function DocView:on_mouse_released(...) print 'on_mouse_released....' return omr(self, ...) --true --false --nil end

local omp = DocView.on_mouse_pressed function DocView:on_mouse_pressed(...) print 'on_mouse_pressed' return omp(self, ...) end

- launch lite from terminal
- see that for every click+release output is one pressed and two released:

on_mouse_pressed on_mouse_released.... on_mouse_released....

SwissalpS commented 1 year ago

adding debug line here: https://github.com/rxi/lite/blob/38bd9b3326c02e43f244623f97a622b11f074415/data/core/init.lua#L338

shows that the error is on lua side. Here there is only one signal.