-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#86] fix Ctrl-a/e while editing #87
Conversation
cmd/hashira-cui/editor.go
Outdated
@@ -16,13 +17,19 @@ func (e *editor) Edit(v *gocui.View, key gocui.Key, ch rune, mod gocui.Modifier) | |||
v.MoveCursor(-1, 0, false) | |||
case gocui.KeyCtrlA: | |||
// move to start of line | |||
_, oy := v.Origin() | |||
v.SetOrigin(0, oy) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
G104: Errors unhandled. (from gosec
)
cmd/hashira-cui/editor.go
Outdated
maxX, _ := v.Size() | ||
v.MoveCursor(-maxX, 0, false) | ||
case gocui.KeyCtrlE: | ||
// move to end of line | ||
bufLen := len(v.Buffer()) | ||
_, oy := v.Origin() | ||
v.SetOrigin(0, oy) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
G104: Errors unhandled. (from gosec
)
_, oy := v.Origin() | ||
err := v.SetOrigin(0, oy) | ||
if err != nil { | ||
log.Printf("failed to set origin: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undeclared name: log (from typecheck
)
bufLen := len(v.Buffer()) | ||
_, oy := v.Origin() | ||
v.SetOrigin(0, oy) | ||
if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undeclared name: err (from typecheck
)
c1ffe4f
to
ff37c2b
Compare
Pull request for issue #86
Updates