fix cursor: push to the right

pull/10/head
Edouard Paris 5 years ago
parent 37a4832361
commit 12e8a8c125

@ -75,10 +75,30 @@ func (c *Channels) CursorUp() error {
}
func (c *Channels) CursorRight() error {
if c.col >= len(c.columns)-1 {
if c.col > len(c.columns)-1 {
return nil
}
speed := c.columns[c.col].width + 1
if c.col == len(c.columns)-1 {
speed := c.columns[c.col].width + 1
err := cursorRight(c.columnsView, speed)
if err != nil {
return err
}
err = cursorRight(c.view, speed)
if err != nil {
return err
}
err = cursorLeft(c.columnsView, speed)
if err != nil {
return err
}
return cursorLeft(c.view, speed)
}
c.col++
err := cursorRight(c.columnsView, speed)
if err != nil {
@ -336,8 +356,8 @@ func NewChannels(cfg *config.View, chans *models.Channels) *Channels {
},
}
}
}
return channels
}

@ -66,10 +66,28 @@ func (c *Transactions) CursorUp() error {
}
func (c *Transactions) CursorRight() error {
if c.col >= len(c.columns)-1 {
if c.col > len(c.columns)-1 {
return nil
}
speed := c.columns[c.col].width + 1
if c.col == len(c.columns)-1 {
speed := c.columns[c.col].width + 1
err := cursorRight(c.columnsView, speed)
if err != nil {
return err
}
err = cursorRight(c.view, speed)
if err != nil {
return err
}
err = cursorLeft(c.columnsView, speed)
if err != nil {
return err
}
return cursorLeft(c.view, speed)
}
c.col++
err := cursorRight(c.columnsView, speed)
if err != nil {

Loading…
Cancel
Save