From b22d310c99c02b00fa4b9446ddc3ede9ad2d0bb7 Mon Sep 17 00:00:00 2001 From: Guillermo Rauch Date: Sat, 2 Jul 2016 15:30:21 -0700 Subject: [PATCH] hyperterm: jump to begining of end at edges of tabs when moving sideways (#22) --- app/hyperterm.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/hyperterm.js b/app/hyperterm.js index f68b8daf..d170af25 100644 --- a/app/hyperterm.js +++ b/app/hyperterm.js @@ -251,6 +251,9 @@ export default class HyperTerm extends Component { const next = this.state.active - 1; if (this.state.sessions[next]) { this.setActive(next); + } else if (this.state.sessions.length > 1) { + // go to the end + this.setActive(this.state.sessions.length - 1); } } @@ -258,6 +261,9 @@ export default class HyperTerm extends Component { const next = this.state.active + 1; if (this.state.sessions[next]) { this.setActive(next); + } else if (this.state.sessions.length > 1) { + // go to the beginning + this.setActive(0); } }