potocpav / xi_glium

Glium-based front-end to the xi editor
MIT License
84 stars 13 forks source link

Scrolling shows >>NOT IN CACHE<< lines #8

Open potocpav opened 8 years ago

potocpav commented 8 years ago

This message was intentional, to detect any cases where extra requests to the back-end could be avoided. But when scrolling using mouse scroll (or, in the future, dragging the scroll-bar), the back-end does not implicitly send an update and the screen is filled with those messages. The data must be requested manually.

In order to do it, the Text object must know about the Core back-end. I think that this fix should be a part of a larger refactor that moves most of the logic out from the Controller struct into the Text struct (the react-to-user-input part). It should also be a preparation for a tabbed interface in the future (hence the Core object becomes an Arc<Mutex>). Maybe even translating the Glutin events to internal events for configurability (but that can wait).

A part of the problem is, where to keep the state of the keyboard and mouse (let (mut ctrl, mut shift) and let mut mouse). It seems good to just pass the state in function parameters, but then the ctrl = false logic in case of opening a File chooser dialog can't be cleanly implemented. I don't know how to deal with that in the best way.