Skip to content

Commit 55901c7

Browse files
authored
Merge pull request #78 from saccarosium/deprecate-buffdo
deprecate mode 'buffer'
2 parents bc824e5 + 169e1e1 commit 55901c7

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ vim.keymap.set('n', '<leader>crp', ':CRProjects<CR>', { noremap = true, silent =
108108

109109
### Options
110110

111-
- `mode`: Mode in which you want to run(default: term, valid options: `{"toggle", "float", "tab", "toggleterm", "buf"}`),
111+
- `mode`: Mode in which you want to run(default: term, valid options: {"toggle", "float", "tab", "toggleterm"}),
112112
- `focus`: Focus on runner window(only works on toggle, term and tab mode, default: true)
113113
- `startinsert`: init in insert mode(default: false)
114114
- `term`: Configurations for the integrated terminal
@@ -153,7 +153,7 @@ Note: A common mistake code runners make is using relative paths and not absolut
153153

154154
```lua
155155
require('code_runner').setup {
156-
-- choose default mode (valid term, tab, float, toggle, buf)
156+
-- choose default mode (valid term, tab, float, toggle)
157157
mode = 'term',
158158
-- Focus on runner window(only works on toggle, term and tab mode)
159159
focus = true,

lua/code_runner/commands.lua

+2-7
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,8 @@ local function execute(command, bufname, prefix)
114114
local set_bufname = "file " .. bufname
115115
local current_wind_id = vim.api.nvim_get_current_win()
116116
close_runner(bufname)
117-
if prefix ~= "bufdo" then
118-
prefix = prefix .. " |"
119-
end
120-
vim.cmd(prefix .. " term " .. command)
117+
vim.cmd(prefix)
118+
vim.fn.termopen(command)
121119
vim.cmd("norm G")
122120
vim.opt_local.relativenumber = false
123121
vim.opt_local.number = false
@@ -170,9 +168,6 @@ M.modes = {
170168
tab = function(command, bufname)
171169
execute(command, bufname, "tabnew")
172170
end,
173-
buf = function(command, bufname)
174-
execute(command, bufname, "bufdo")
175-
end,
176171
toggleterm = function(command, ...)
177172
local tcmd = string.format('TermExec cmd="%s"', command)
178173
vim.cmd(tcmd)

0 commit comments

Comments
 (0)