hiiro 0.1.195 → 0.1.196
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.
- checksums.yaml +4 -4
- data/bin/h-claude +9 -34
- data/lib/hiiro/tmux.rb +16 -3
- data/lib/hiiro/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2af78273119c7e6d0f86e2b9d2d08731764565d1916d778d96f4060acb35382c
|
|
4
|
+
data.tar.gz: fe0f4b4c9109bb8860bd6e978279b39d1e83cc27a8704195d8b04617b90e7a8c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 22425cea8ad3bf9ca19b42923091d2503b12d84c81736858edc71d7575965033b7c9f82d98335379757cb72729679a5042e23fc5d75a325e73e09686374bdf67
|
|
7
|
+
data.tar.gz: 55a814d2c0c3467a76447f643866e14d26a881cdf650e2f244d3926d4e87a1f2e6917a05e993d13ed9a5d91c2e46bd615d778fff33999376bf5a0e0446d21baf
|
data/bin/h-claude
CHANGED
|
@@ -25,56 +25,31 @@ end
|
|
|
25
25
|
Hiiro.run(*ARGV, plugins: [Pins]) {
|
|
26
26
|
add_subcmd(:split) { |*args|
|
|
27
27
|
opts = opts.parse(args)
|
|
28
|
-
direction = opts.horizontal ? '-v' : '-h'
|
|
29
28
|
|
|
30
29
|
size = opts.size || '40'
|
|
31
30
|
size += '%' if opts.percent
|
|
32
31
|
|
|
33
|
-
|
|
32
|
+
tmux_client.split_window(horizontal: !opts.horizontal, size: size, command: start_command(opts))
|
|
34
33
|
}
|
|
35
34
|
|
|
36
35
|
add_subcmd(:vsplit) { |*args|
|
|
37
|
-
cmd = %w[
|
|
38
|
-
tmux split-window -h
|
|
39
|
-
]
|
|
40
|
-
|
|
41
36
|
opts = opts.parse(args)
|
|
42
37
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
size += '%' if opts.percent
|
|
46
|
-
|
|
47
|
-
cmd << '-l'
|
|
48
|
-
cmd << size
|
|
49
|
-
end
|
|
38
|
+
size = opts.size
|
|
39
|
+
size += '%' if size && opts.percent
|
|
50
40
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
if opts.left
|
|
54
|
-
system('tmux', 'swap-pane', '-d', '-t', '0')
|
|
55
|
-
end
|
|
41
|
+
tmux_client.vsplit_window(size: size, command: start_command(opts))
|
|
42
|
+
tmux_client.swap_current_pane(0, keep_active: true) if opts.left
|
|
56
43
|
}
|
|
57
44
|
|
|
58
45
|
add_subcmd(:hsplit) { |*args|
|
|
59
|
-
cmd = %w[
|
|
60
|
-
tmux split-window -v
|
|
61
|
-
]
|
|
62
|
-
|
|
63
46
|
opts = opts.parse(args)
|
|
64
47
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
size += '%' if opts.percent
|
|
68
|
-
|
|
69
|
-
cmd << '-l'
|
|
70
|
-
cmd << size
|
|
71
|
-
end
|
|
48
|
+
size = opts.size
|
|
49
|
+
size += '%' if size && opts.percent
|
|
72
50
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
unless opts.bottom
|
|
76
|
-
system('tmux', 'swap-pane', '-d', '-t', '0')
|
|
77
|
-
end
|
|
51
|
+
tmux_client.hsplit_window(size: size, command: start_command(opts))
|
|
52
|
+
tmux_client.swap_current_pane(0, keep_active: true) unless opts.bottom
|
|
78
53
|
}
|
|
79
54
|
|
|
80
55
|
add_subcmd(:env) { |*args|
|
data/lib/hiiro/tmux.rb
CHANGED
|
@@ -199,12 +199,22 @@ class Hiiro
|
|
|
199
199
|
|
|
200
200
|
# Pane methods
|
|
201
201
|
|
|
202
|
-
def
|
|
202
|
+
def vsplit_window(**kwargs)
|
|
203
|
+
split_window(horizontal: false, **kwargs)
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
def hsplit_window(**kwargs)
|
|
207
|
+
split_window(horizontal: true, **kwargs)
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
def split_window(horizontal: false, target: nil, start_directory: nil, size: nil, command: nil)
|
|
203
211
|
args = ['split-window']
|
|
204
212
|
args << '-h' if horizontal
|
|
205
213
|
args << '-v' unless horizontal
|
|
206
214
|
args += ['-t', target] if target
|
|
207
215
|
args += ['-c', start_directory] if start_directory
|
|
216
|
+
args += ['-l', size] if size
|
|
217
|
+
args << command if command
|
|
208
218
|
run_system(*args)
|
|
209
219
|
end
|
|
210
220
|
|
|
@@ -216,8 +226,11 @@ class Hiiro
|
|
|
216
226
|
run_system('select-pane', '-t', target)
|
|
217
227
|
end
|
|
218
228
|
|
|
219
|
-
def swap_current_pane(dst=0)
|
|
220
|
-
|
|
229
|
+
def swap_current_pane(dst=0, keep_active: false)
|
|
230
|
+
args = ['swap-pane']
|
|
231
|
+
args << '-d' if keep_active
|
|
232
|
+
args += ['-t', dst&.to_s]
|
|
233
|
+
run_system(*args)
|
|
221
234
|
end
|
|
222
235
|
|
|
223
236
|
def swap_pane(src, dst)
|
data/lib/hiiro/version.rb
CHANGED