mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-23 09:17:08 +09:00
Fix reading clipboard internally for OSC52
This commit is contained in:
@@ -27,7 +27,6 @@ import (
|
||||
|
||||
var (
|
||||
// Event channel
|
||||
events chan tcell.Event
|
||||
autosave chan bool
|
||||
|
||||
// Command line flags
|
||||
@@ -321,7 +320,7 @@ func main() {
|
||||
action.InfoBar.Error(clipErr, " or change 'clipboard' option")
|
||||
}
|
||||
|
||||
events = make(chan tcell.Event)
|
||||
screen.Events = make(chan tcell.Event)
|
||||
|
||||
// Here is the event loop which runs in a separate thread
|
||||
go func() {
|
||||
@@ -330,7 +329,7 @@ func main() {
|
||||
e := screen.Screen.PollEvent()
|
||||
screen.Unlock()
|
||||
if e != nil {
|
||||
events <- e
|
||||
screen.Events <- e
|
||||
}
|
||||
}
|
||||
}()
|
||||
@@ -343,7 +342,7 @@ func main() {
|
||||
|
||||
// wait for initial resize event
|
||||
select {
|
||||
case event := <-events:
|
||||
case event := <-screen.Events:
|
||||
action.Tabs.HandleEvent(event)
|
||||
case <-time.After(10 * time.Millisecond):
|
||||
// time out after 10ms
|
||||
@@ -396,7 +395,7 @@ func DoEvent() {
|
||||
}
|
||||
ulua.Lock.Unlock()
|
||||
case <-shell.CloseTerms:
|
||||
case event = <-events:
|
||||
case event = <-screen.Events:
|
||||
case <-screen.DrawChan():
|
||||
for len(screen.DrawChan()) > 0 {
|
||||
<-screen.DrawChan()
|
||||
|
||||
@@ -20,7 +20,7 @@ var tempDir string
|
||||
var sim tcell.SimulationScreen
|
||||
|
||||
func init() {
|
||||
events = make(chan tcell.Event, 8)
|
||||
screen.Events = make(chan tcell.Event, 8)
|
||||
}
|
||||
|
||||
func startup(args []string) (tcell.SimulationScreen, error) {
|
||||
@@ -106,7 +106,7 @@ func handleEvent() {
|
||||
e := screen.Screen.PollEvent()
|
||||
screen.Unlock()
|
||||
if e != nil {
|
||||
events <- e
|
||||
screen.Events <- e
|
||||
}
|
||||
DoEvent()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user