Skip to content

Commit d66ba6b

Browse files
authored
Merge pull request #1002 from siamak-amo/feature/tmux_like_navigate
Tmux-like navigation feature
2 parents a11fc9b + a32d3ef commit d66ba6b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

terminatorlib/window.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,15 @@ def navigate_terminal(self, terminal, direction):
916916

917917
# Get the coordinate of the appropriate edge for this direction
918918
edge, p1, p2 = util.get_edge(allocation, direction)
919+
cols, rows = self.get_size()
920+
if ((direction == 'down' and edge >= rows) or
921+
(direction == 'right' and edge >= cols)):
922+
edge = 0
923+
elif (direction == 'up' and edge == 0):
924+
edge = rows
925+
elif (direction == 'left' and edge == 0):
926+
edge = cols
927+
919928
# Find all visible terminals which are, in their entirety, in the
920929
# direction we want to move, and are at least partially spanning
921930
# p1 to p2

0 commit comments

Comments
 (0)