rxi / lite

A lightweight text editor written in Lua

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[bug] DocView.on_mouse_released() gets called twice

SwissalpS opened this issue · comments

to reproduce:

  • clone/checkout master at [38bd9b3] (latest as of this writing)
  • build it
  • add this plugin:
local DocView = require "core.docview"

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....

adding debug line here:

core.root_view:on_mouse_released(...)

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