Files
gio/ui/text
Elias Naur dc6fedc163 ui: change Queue to return all events at once
The Queue interface was changed from

	type Queue interface {
		Events(k Key) []Event
	}

to the more complex single-step protocol

	type Queue interface {
		Next(k Key) (Event, bool)
	}

to cater for a particular use case: Editor's SubmitEvent. When a
SubmitEvent is passed to a caller of Editor.Next, the Editor state,
in particular the current text, must not have changed by edits
later in the command stream. For example, pressing the keys <E>,
<Enter>, <E> should result in a SubmitEvent where the Editor has
a single 'e' in Text(), not two.

However, there is no reason to push the more complex Queue to every user.
Rather, store remaining input events inside Editor and process them as
Editor.Event (or Layout) is called.

Finally, revert the Queue interface to the simpler Events method.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-09-26 18:41:03 +02:00
..