mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-30 06:37:14 +09:00
Better softwrap
This commit is contained in:
@@ -40,7 +40,7 @@ func (h *BufPane) ScrollDown(n int) {
|
||||
func (h *BufPane) MousePress(e *tcell.EventMouse) bool {
|
||||
b := h.Buf
|
||||
mx, my := e.Position()
|
||||
mouseLoc := h.GetMouseLoc(buffer.Loc{mx, my})
|
||||
mouseLoc := h.LocFromVisual(buffer.Loc{mx, my})
|
||||
h.Cursor.Loc = mouseLoc
|
||||
if h.mouseReleased {
|
||||
if b.NumCursors() > 1 {
|
||||
@@ -1410,7 +1410,7 @@ func (h *BufPane) SpawnMultiCursorSelect() bool {
|
||||
func (h *BufPane) MouseMultiCursor(e *tcell.EventMouse) bool {
|
||||
b := h.Buf
|
||||
mx, my := e.Position()
|
||||
mouseLoc := h.GetMouseLoc(buffer.Loc{X: mx, Y: my})
|
||||
mouseLoc := h.LocFromVisual(buffer.Loc{X: mx, Y: my})
|
||||
c := buffer.NewCursor(b, mouseLoc)
|
||||
b.AddCursor(c)
|
||||
b.MergeCursors()
|
||||
|
||||
@@ -241,7 +241,7 @@ func (h *BufPane) HandleEvent(event tcell.Event) {
|
||||
// Mouse was just released
|
||||
|
||||
mx, my := e.Position()
|
||||
mouseLoc := h.GetMouseLoc(buffer.Loc{X: mx, Y: my})
|
||||
mouseLoc := h.LocFromVisual(buffer.Loc{X: mx, Y: my})
|
||||
|
||||
// Relocating here isn't really necessary because the cursor will
|
||||
// be in the right place from the last mouse event
|
||||
|
||||
@@ -103,7 +103,7 @@ func (t *TabList) HandleEvent(event tcell.Event) {
|
||||
mx, my := e.Position()
|
||||
switch e.Buttons() {
|
||||
case tcell.Button1:
|
||||
ind := t.GetMouseLoc(buffer.Loc{mx, my})
|
||||
ind := t.LocFromVisual(buffer.Loc{mx, my})
|
||||
if ind != -1 {
|
||||
t.SetActive(ind)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user