ui/input: change Queue to return Events one at a time

By returning all events, widgets that might return early from its
event loop might throw away subsequent events. Instead of requiring
those widgets to store the event list, convert input.Queue to step
through the available events one at a time.

Functional revert of 1735d5ced8.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-08-01 18:56:49 +02:00
parent b15a32065f
commit 73b1e64209
5 changed files with 15 additions and 11 deletions
+1 -1
View File
@@ -113,7 +113,7 @@ func (e *Editor) Next(cfg ui.Config, queue input.Queue) (EditorEvent, bool) {
if (sdist > 0 && soff >= smax) || (sdist < 0 && soff <= smin) {
e.scroller.Stop()
}
for _, ke := range queue.Events(e) {
for ke, ok := queue.Next(e); ok; ke, ok = queue.Next(e) {
e.blinkStart = cfg.Now()
switch ke := ke.(type) {
case key.FocusEvent: