"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/micro/v2/internal/shell"
"github.com/zyedidia/micro/v2/internal/util"
- "github.com/zyedidia/tcell"
+ "github.com/zyedidia/tcell/v2"
)
var (
if screen.Screen != nil {
screen.Screen.Fini()
}
- fmt.Println("Micro encountered an error:", err)
+ if e, ok := err.(*lua.ApiError); ok {
+ fmt.Println("Lua API error:", e)
+ } else {
+ fmt.Println("Micro encountered an error:", errors.Wrap(err, 2).ErrorStack(), "\nIf you can reproduce this error, please report it at https://github.com/zyedidia/micro/issues")
+ }
// backup all open buffers
for _, b := range buffer.OpenBuffers {
b.Backup()
}
- // Print the stack trace too
- fmt.Print(errors.Wrap(err, 2).ErrorStack())
os.Exit(1)
}
}()
// time out after 10ms
}
- // Since this loop is very slow (waits for user input every time) it's
- // okay to be inefficient and run it via a function every time
- // We do this so we can recover from panics without crashing the editor
for {
DoEvent()
}
func DoEvent() {
var event tcell.Event
- // recover from errors without crashing the editor
- defer func() {
- if err := recover(); err != nil {
- if e, ok := err.(*lua.ApiError); ok {
- screen.TermMessage("Lua API error:", e)
- } else {
- screen.TermMessage("Micro encountered an error:", errors.Wrap(err, 2).ErrorStack(), "\nIf you can reproduce this error, please report it at https://github.com/zyedidia/micro/issues")
- }
- }
- }()
// Display everything
screen.Screen.Fill(' ', config.DefStyle)
screen.Screen.HideCursor()
}
ulua.Lock.Lock()
+ // if event != nil {
if action.InfoBar.HasPrompt {
action.InfoBar.HandleEvent(event)
} else {
action.Tabs.HandleEvent(event)
}
+ // }
ulua.Lock.Unlock()
}
"github.com/zyedidia/micro/v2/internal/buffer"
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/screen"
- "github.com/zyedidia/tcell"
+ "github.com/zyedidia/tcell/v2"
)
var tempDir string
github.com/zyedidia/highlight v0.0.0-20170330143449-201131ce5cf5
github.com/zyedidia/json5 v0.0.0-20200102012142-2da050b1a98d
github.com/zyedidia/pty v2.0.0+incompatible // indirect
- github.com/zyedidia/tcell v1.4.12
+ github.com/zyedidia/tcell/v2 v2.0.0
github.com/zyedidia/terminal v0.0.0-20180726154117-533c623e2415
golang.org/x/text v0.3.2
gopkg.in/sourcemap.v1 v1.0.5 // indirect
github.com/zyedidia/pty v2.0.0+incompatible/go.mod h1:4y9l9yJZNxRa7GB/fB+mmDmGkG3CqmzLf4vUxGGotEA=
github.com/zyedidia/tcell v1.4.12 h1:PwsWfTKDvgSsMKL8QfFqxrD2qxZk6apxxKOJwjhLbxs=
github.com/zyedidia/tcell v1.4.12/go.mod h1:HhlbMSCcGX15rFDB+Q1Lk3pKEOocsCUAQC3zhZ9sadA=
+github.com/zyedidia/tcell/v2 v2.0.0 h1:d6q7nFhAkbCdK3znpOfsStRIbavCvHX0wb7h3NJ4Lzc=
+github.com/zyedidia/tcell/v2 v2.0.0/go.mod h1:PT4YXe+nkU4iuQAPFfkMAZAYFQEnscyAxKsZ9B5Kl1w=
github.com/zyedidia/terminal v0.0.0-20180726154117-533c623e2415 h1:752dTQ5OatJ9M5ULK2+9lor+nzyZz+LYDo3WGngg3Rc=
github.com/zyedidia/terminal v0.0.0-20180726154117-533c623e2415/go.mod h1:8leT8G0Cm8NoJHdrrKHyR9MirWoF4YW7pZh06B6H+1E=
golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/micro/v2/internal/shell"
"github.com/zyedidia/micro/v2/internal/util"
- "github.com/zyedidia/tcell"
+ "github.com/zyedidia/tcell/v2"
)
// ScrollUp is not an action
"github.com/zyedidia/json5"
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/screen"
- "github.com/zyedidia/tcell"
+ "github.com/zyedidia/tcell/v2"
)
var Binder = map[string]func(e Event, action string){
}
var mouseEvents = map[string]tcell.ButtonMask{
- "MouseLeft": tcell.Button1,
- "MouseMiddle": tcell.Button2,
- "MouseRight": tcell.Button3,
+ "MouseLeft": tcell.ButtonPrimary,
+ "MouseMiddle": tcell.ButtonMiddle,
+ "MouseRight": tcell.ButtonSecondary,
"MouseWheelUp": tcell.WheelUp,
"MouseWheelDown": tcell.WheelDown,
"MouseWheelLeft": tcell.WheelLeft,
"github.com/zyedidia/micro/v2/internal/display"
ulua "github.com/zyedidia/micro/v2/internal/lua"
"github.com/zyedidia/micro/v2/internal/screen"
- "github.com/zyedidia/tcell"
+ "github.com/zyedidia/tcell/v2"
)
type BufKeyAction func(*BufPane) bool
"fmt"
"strings"
- "github.com/zyedidia/tcell"
+ "github.com/zyedidia/tcell/v2"
)
type Event interface {
"github.com/zyedidia/micro/v2/internal/display"
"github.com/zyedidia/micro/v2/internal/info"
"github.com/zyedidia/micro/v2/internal/util"
- "github.com/zyedidia/tcell"
+ "github.com/zyedidia/tcell/v2"
)
type InfoKeyAction func(*InfoPane)
import (
"bytes"
- "github.com/zyedidia/tcell"
+ "github.com/zyedidia/tcell/v2"
)
type PaneKeyAction func(Pane) bool
"github.com/zyedidia/micro/v2/internal/buffer"
"github.com/zyedidia/micro/v2/internal/display"
- "github.com/zyedidia/tcell"
+ "github.com/zyedidia/tcell/v2"
)
type RawPane struct {
"github.com/zyedidia/micro/v2/internal/display"
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/micro/v2/internal/views"
- "github.com/zyedidia/tcell"
+ "github.com/zyedidia/tcell/v2"
)
// The TabList is a list of tabs and a window to display the tab bar
"github.com/zyedidia/micro/v2/internal/display"
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/micro/v2/internal/shell"
- "github.com/zyedidia/tcell"
+ "github.com/zyedidia/tcell/v2"
"github.com/zyedidia/terminal"
)
import (
"github.com/zyedidia/micro/v2/internal/config"
- "github.com/zyedidia/tcell"
+ "github.com/zyedidia/tcell/v2"
)
type MsgType int
"time"
"github.com/zyedidia/micro/v2/internal/screen"
- "github.com/zyedidia/tcell"
+ "github.com/zyedidia/tcell/v2"
)
type terminalClipboard struct{}
"strconv"
"strings"
- "github.com/zyedidia/tcell"
+ "github.com/zyedidia/tcell/v2"
)
// Micro's default style
"testing"
"github.com/stretchr/testify/assert"
- "github.com/zyedidia/tcell"
+ "github.com/zyedidia/tcell/v2"
)
func TestSimpleStringToStyle(t *testing.T) {
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/micro/v2/internal/util"
- "github.com/zyedidia/tcell"
+ "github.com/zyedidia/tcell/v2"
)
// The BufWindow provides a way of displaying a certain section
"github.com/zyedidia/micro/v2/internal/info"
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/micro/v2/internal/util"
- "github.com/zyedidia/tcell"
+ "github.com/zyedidia/tcell/v2"
)
type InfoWindow struct {
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/micro/v2/internal/shell"
"github.com/zyedidia/micro/v2/internal/util"
- "github.com/zyedidia/tcell"
+ "github.com/zyedidia/tcell/v2"
"github.com/zyedidia/terminal"
)
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/util"
- "github.com/zyedidia/tcell"
+ "github.com/zyedidia/tcell/v2"
)
// Screen is the tcell screen we use to draw to the terminal