editprompt 0.5.0 → 0.5.1
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.
- package/README.md +4 -3
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -120,7 +120,7 @@ While editprompt is running, you can send content to the target pane or clipboar
|
|
|
120
120
|
|
|
121
121
|
```bash
|
|
122
122
|
# Run this command from within your editor session
|
|
123
|
-
editprompt
|
|
123
|
+
editprompt "your content here"
|
|
124
124
|
```
|
|
125
125
|
|
|
126
126
|
This sends the content to the target pane (or clipboard) while keeping your editor open, so you can continue editing and send multiple times.
|
|
@@ -133,20 +133,21 @@ You can set up a convenient keybinding to send your buffer content:
|
|
|
133
133
|
-- Send buffer content while keeping the editor open
|
|
134
134
|
if vim.env.EDITPROMPT then
|
|
135
135
|
vim.keymap.set("n", "<Space>x", function()
|
|
136
|
-
vim.cmd("
|
|
136
|
+
vim.cmd("update")
|
|
137
137
|
-- Get buffer content
|
|
138
138
|
local lines = vim.api.nvim_buf_get_lines(0, 0, -1, false)
|
|
139
139
|
local content = table.concat(lines, "\n")
|
|
140
140
|
|
|
141
141
|
-- Execute editprompt command
|
|
142
142
|
vim.system(
|
|
143
|
-
{ "editprompt",
|
|
143
|
+
{ "editprompt", content },
|
|
144
144
|
{ text = true },
|
|
145
145
|
function(obj)
|
|
146
146
|
vim.schedule(function()
|
|
147
147
|
if obj.code == 0 then
|
|
148
148
|
-- Clear buffer on success
|
|
149
149
|
vim.api.nvim_buf_set_lines(0, 0, -1, false, {})
|
|
150
|
+
vim.cmd("silent write")
|
|
150
151
|
else
|
|
151
152
|
-- Show error notification
|
|
152
153
|
vim.notify("editprompt failed: " .. (obj.stderr or "unknown error"), vim.log.levels.ERROR)
|
package/dist/index.js
CHANGED