hiiro 0.1.375 → 0.1.376
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/CHANGELOG.md +5 -0
- data/bin/h-herdr +16 -5
- data/docs/h-herdr.md +1 -1
- data/herdr-plugin/herdr-plugin.toml +1 -1
- 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: a8a343767837132ea50864926898caf5fcbc01788bbfadd351f426fe6e7bc770
|
|
4
|
+
data.tar.gz: e8274d74d87414a087f45f3bf65584ecec9ffd999d48ca5328591e729babdf9e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 46b9f915a21b4c84a14971b5b30aa1a6f48f1507b049eb4ff59546e627c9eccb84cc0ac8863591dc50ab4f4ae4afff3af45c599c430751bcc3b1b7bb3e81fefc
|
|
7
|
+
data.tar.gz: 45c777ea183fbc5eb26de72be4b7a4e303423c76f0ca99431b492d6615e82d296932cddb17c46f7f2ea6dabdd936e2762290d9a81375dc5d82413f35d770fabe
|
data/CHANGELOG.md
CHANGED
data/bin/h-herdr
CHANGED
|
@@ -86,8 +86,20 @@ Hiiro.run(*ARGV, external_commands: false) do
|
|
|
86
86
|
name = opts.args.first
|
|
87
87
|
raise Hiiro::Error, "Unknown action #{name}; one of #{ACTIONS.join(', ')}" unless ACTIONS.include?(name)
|
|
88
88
|
size = %w[shell nvim].include?(name) ? %w[--width 90% --height 90%] : []
|
|
89
|
+
extra = []
|
|
90
|
+
if name == 'nvim' && (cwd = calling_pane_cwd)
|
|
91
|
+
extra = ['--cwd', cwd, '--env', "HIIRO_HERDR_CWD=#{cwd}"]
|
|
92
|
+
end
|
|
89
93
|
system(herdr_bin, 'plugin', 'pane', 'open', '--plugin', PLUGIN_ID, '--entrypoint', 'popup',
|
|
90
|
-
'--env', "HIIRO_HERDR_ACTION=#{name}", *size, '--focus')
|
|
94
|
+
'--env', "HIIRO_HERDR_ACTION=#{name}", *size, *extra, '--focus')
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Working directory of the pane the key was pressed in (HERDR_PANE_ID, else the focused pane).
|
|
98
|
+
def calling_pane_cwd
|
|
99
|
+
pane = ENV['HERDR_PANE_ID'] ? herdr_client.get_pane(ENV['HERDR_PANE_ID']) : herdr_client.panes(all: true).find(&:focused?)
|
|
100
|
+
pane && (pane.foreground_cwd || pane.cwd)
|
|
101
|
+
rescue StandardError
|
|
102
|
+
nil
|
|
91
103
|
end
|
|
92
104
|
|
|
93
105
|
# Runs inside the popup pane (real TTY, HERDR_WORKSPACE_ID set by Herdr).
|
|
@@ -144,10 +156,9 @@ Hiiro.run(*ARGV, external_commands: false) do
|
|
|
144
156
|
when 'shell'
|
|
145
157
|
exec('t', 'sh')
|
|
146
158
|
when 'nvim'
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
exec(ENV['EDITOR'] || 'nvim', '.')
|
|
159
|
+
cwd = ENV['HIIRO_HERDR_CWD']
|
|
160
|
+
Dir.chdir(cwd) if cwd && Dir.exist?(cwd)
|
|
161
|
+
exec(ENV['EDITOR'] || 'nvim')
|
|
151
162
|
end
|
|
152
163
|
rescue Hiiro::Error => e
|
|
153
164
|
pause("ERROR: #{e.message}")
|
data/docs/h-herdr.md
CHANGED
|
@@ -20,7 +20,7 @@ herdr server reload-config
|
|
|
20
20
|
| `hiiro.todo-add` | `prefix+shift+a` | Fuzzy-pick a task (current task first), type the todo text, then `t NAME todo add TEXT` |
|
|
21
21
|
| `hiiro.todos` | `prefix+shift+y` | Fuzzy-pick an open todo of the current task and copy its text to the clipboard |
|
|
22
22
|
| `hiiro.shell` | `prefix+shift+s` | 90% popup running `t sh` in the current task's start directory |
|
|
23
|
-
| `hiiro.nvim` | `prefix+shift+e` | 90% popup running `$EDITOR` (default `nvim`) in the
|
|
23
|
+
| `hiiro.nvim` | `prefix+shift+e` | 90% popup running bare `$EDITOR` (default `nvim`) in the working directory of the pane the key was pressed in |
|
|
24
24
|
|
|
25
25
|
The current task resolves through `Hiiro::CurrentTask`: the popup's Herdr workspace, then the working directory, then the task saved with `t use TASK`. Errors print in the popup for two seconds before it closes.
|
|
26
26
|
|
data/lib/hiiro/version.rb
CHANGED