|
@@ -33,13 +33,37 @@ func DefaultActionManager() ActionManager {
|
|
|
Action{
|
|
Action{
|
|
|
Binding: "left",
|
|
Binding: "left",
|
|
|
Callback: func(m *Model, args []string) {
|
|
Callback: func(m *Model, args []string) {
|
|
|
- m.BM.Current().MoveHoriz(-1)
|
|
|
|
|
|
|
+ if m.Mode == ModePalette {
|
|
|
|
|
+ m.BM.PaletteBuffer.MoveHoriz(-1)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ m.BM.Current().MoveHoriz(-1)
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
Action{
|
|
Action{
|
|
|
Binding: "right",
|
|
Binding: "right",
|
|
|
Callback: func(m *Model, args []string) {
|
|
Callback: func(m *Model, args []string) {
|
|
|
- m.BM.Current().MoveHoriz(1)
|
|
|
|
|
|
|
+ if m.Mode == ModePalette {
|
|
|
|
|
+ m.BM.PaletteBuffer.MoveHoriz(1)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ m.BM.Current().MoveHoriz(1)
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+ Action{
|
|
|
|
|
+ Binding: "up",
|
|
|
|
|
+ Callback: func(m *Model, args []string) {
|
|
|
|
|
+ if m.Mode != ModePalette {
|
|
|
|
|
+ m.BM.Current().MoveVert(-1)
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+ Action{
|
|
|
|
|
+ Binding: "down",
|
|
|
|
|
+ Callback: func(m *Model, args []string) {
|
|
|
|
|
+ if m.Mode != ModePalette {
|
|
|
|
|
+ m.BM.Current().MoveVert(1)
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
Action{
|
|
Action{
|
|
@@ -121,6 +145,7 @@ func DefaultActionManager() ActionManager {
|
|
|
m.BM.Current().Clear()
|
|
m.BM.Current().Clear()
|
|
|
m.BM.Current().Rope = rope.New(content)
|
|
m.BM.Current().Rope = rope.New(content)
|
|
|
m.BM.Current().LI.Rebuild(m.BM.Current().Rope)
|
|
m.BM.Current().LI.Rebuild(m.BM.Current().Rope)
|
|
|
|
|
+ m.BM.Current().Path = args[0]
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
@@ -150,18 +175,6 @@ func DefaultActionManager() ActionManager {
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
Insert: []Action{
|
|
Insert: []Action{
|
|
|
- Action{
|
|
|
|
|
- Binding: "up",
|
|
|
|
|
- Callback: func(m *Model, args []string) {
|
|
|
|
|
- m.BM.Current().MoveVert(-1)
|
|
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
- Action{
|
|
|
|
|
- Binding: "down",
|
|
|
|
|
- Callback: func(m *Model, args []string) {
|
|
|
|
|
- m.BM.Current().MoveVert(1)
|
|
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
Action{
|
|
Action{
|
|
|
Binding: "shift+up",
|
|
Binding: "shift+up",
|
|
|
Command: "TODO:",
|
|
Command: "TODO:",
|
|
@@ -225,18 +238,6 @@ func DefaultActionManager() ActionManager {
|
|
|
m.BM.PaletteBuffer.Delete()
|
|
m.BM.PaletteBuffer.Delete()
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
- Action{
|
|
|
|
|
- Binding: "left",
|
|
|
|
|
- Callback: func(m *Model, args []string) {
|
|
|
|
|
- m.BM.PaletteBuffer.MoveHoriz(-1)
|
|
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
- Action{
|
|
|
|
|
- Binding: "right",
|
|
|
|
|
- Callback: func(m *Model, args []string) {
|
|
|
|
|
- m.BM.PaletteBuffer.MoveHoriz(1)
|
|
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
Action{
|
|
Action{
|
|
|
Binding: "enter",
|
|
Binding: "enter",
|
|
|
Callback: func(m *Model, _ []string) {
|
|
Callback: func(m *Model, _ []string) {
|