Skip to content
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

Merged
merged 2 commits into from Dec 20, 2018
Merged

[#86] fix Ctrl-a/e while editing #87

merged 2 commits into from Dec 20, 2018

Conversation

pankona
Copy link
Owner

@pankona pankona commented Dec 20, 2018

Pull request for issue #86

Updates

  • fix Ctrl-a/e while editing to work correctly

@@ -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)

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)

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)

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)

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 {

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)

@pankona pankona merged commit 5f8e1d3 into master Dec 20, 2018
@pankona pankona deleted the 86-ctrl-a-e-fix branch December 20, 2018 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants