Skip to content

Commit

Permalink
fix cursor redirection when undo-change line-redo
Browse files Browse the repository at this point in the history
  • Loading branch information
Giessen committed Aug 5, 2024
1 parent 2259fd1 commit 7d37e72
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions internal/buffer/eventhandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ func (eh *EventHandler) UndoOneEvent() {
// Set the cursor in the right place
teCursor := t.C
if teCursor.Num >= 0 && teCursor.Num < len(eh.cursors) {
t.C = *eh.cursors[teCursor.Num]
//@ t.C = *eh.cursors[teCursor.Num]
eh.cursors[teCursor.Num].Goto(teCursor)
eh.cursors[teCursor.Num].NewTrailingWsY = teCursor.NewTrailingWsY
} else {
Expand Down Expand Up @@ -338,7 +338,7 @@ func (eh *EventHandler) RedoOneEvent() {

teCursor := t.C
if teCursor.Num >= 0 && teCursor.Num < len(eh.cursors) {
t.C = *eh.cursors[teCursor.Num]
//@ t.C = *eh.cursors[teCursor.Num]
eh.cursors[teCursor.Num].Goto(teCursor)
eh.cursors[teCursor.Num].NewTrailingWsY = teCursor.NewTrailingWsY
} else {
Expand Down
5 changes: 4 additions & 1 deletion internal/display/infowindow.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ func (i *InfoWindow) displayBuffer() {
}
}

var keydisplay = []string{"^Q Quit, ^S Save, ^O Open, ^G Help, ^E Command Bar, ^K Cut Line", "^F Find, ^Z Undo, ^Y Redo, ^A Select All, ^D Duplicate Line, ^T New Tab"}
//var keydisplay = []string{"^Q Quit, ^S Save, ^O Open, ^G Help, ^E Command Bar, ^K Cut Line", "^F Find, ^Z Undo, ^Y Redo, ^A Select All, ^D Duplicate Line, ^T New Tab"}
//@ ^D Duplicate Line
var keydisplay = []string{"^X Quit, ^S Save, ^O Open, ^T New Tab, F5/6 CMD/SH, ^K/C|J Cut/Copy, ^G/D Goto/Del Line",
"^F Find, ^Z Undo, ^Y Redo, ^A Mark All, ^/ Comment, ^V|U Paste, ^I Find Text"}

func (i *InfoWindow) displayKeyMenu() {
// TODO: maybe make this based on the actual keybindings
Expand Down

0 comments on commit 7d37e72

Please sign in to comment.