muxr 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/muxr/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Muxr
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.7"
3
3
  end
data/lib/muxr/window.rb CHANGED
@@ -86,6 +86,19 @@ module Muxr
86
86
  @panes[i], @panes[j] = @panes[j], @panes[i]
87
87
  end
88
88
 
89
+ # Swap the focused pane with the pane at `idx` and keep focus on the
90
+ # moved pane (so HJKL can keep dragging it across the layout). Unlike
91
+ # `focused_index=`, this does not record a last_focused_pane — the user
92
+ # is still on the same pane, just at a new index in the array.
93
+ def move_focused_to(idx)
94
+ return false if @panes.empty?
95
+ return false unless idx.is_a?(Integer) && idx >= 0 && idx < @panes.length
96
+ return false if idx == @focused_index
97
+ @panes[@focused_index], @panes[idx] = @panes[idx], @panes[@focused_index]
98
+ @focused_index = idx
99
+ true
100
+ end
101
+
89
102
  def cycle_layout
90
103
  i = LAYOUTS.index(@layout) || 0
91
104
  @layout = LAYOUTS[(i + 1) % LAYOUTS.length]
data/lib/muxr.rb CHANGED
@@ -3,6 +3,7 @@ require_relative "muxr/pty_process"
3
3
  require_relative "muxr/terminal"
4
4
  require_relative "muxr/pane"
5
5
  require_relative "muxr/drawer"
6
+ require_relative "muxr/foreground_command"
6
7
  require_relative "muxr/layout_manager"
7
8
  require_relative "muxr/window"
8
9
  require_relative "muxr/session"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: muxr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roel Bondoc
@@ -61,6 +61,7 @@ files:
61
61
  - lib/muxr/command_dispatcher.rb
62
62
  - lib/muxr/control_server.rb
63
63
  - lib/muxr/drawer.rb
64
+ - lib/muxr/foreground_command.rb
64
65
  - lib/muxr/input_handler.rb
65
66
  - lib/muxr/key_parser.rb
66
67
  - lib/muxr/layout_manager.rb