Skip to content

Commit 49b8941

Browse files
committed
feat: add cmake_use_scratch_buffer option
1 parent 1ee065c commit 49b8941

4 files changed

Lines changed: 4 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ require("cmake-tools").setup {
163163
refresh_rate_ms = 100, -- how often to iterate icons
164164
},
165165
cmake_virtual_text_support = true, -- Show the target related to current file using virtual text (at right corner)
166+
cmake_use_scratch_buffer = false, -- A buffer that shows what cmake-tools has done
166167
}
167168
```
168169

lua/cmake-tools/const.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ local const = {
134134
refresh_rate_ms = 100, -- how often to iterate icons
135135
},
136136
cmake_virtual_text_support = true, -- Show the target related to current file using virtual text (at right corner)
137+
cmake_use_scratch_buffer = false, -- A buffer that shows what cmake-tools has done
137138
}
138139

139140
return const

lua/cmake-tools/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1524,7 +1524,7 @@ function cmake.register_autocmd_provided_by_users()
15241524
end
15251525

15261526
function cmake.register_scratch_buffer(executor, runner)
1527-
if cmake.is_cmake_project() then
1527+
if cmake.is_cmake_project() and const.cmake_use_scratch_buffer then
15281528
vim.schedule(function()
15291529
scratch.create(executor, runner)
15301530
end)

lua/cmake-tools/scratch.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function scratch.create(executor, runner)
1414
"THIS IS A SCRATCH BUFFER FOR cmake-tools.nvim, YOU CAN SEE WHICH COMMAND THIS PLUGIN EXECUTES HERE.",
1515
"EXECUTOR: " .. executor .. " RUNNER: " .. runner,
1616
})
17-
vim.api.nvim_buf_set_option(scratch.buffer, "buflisted", false)
17+
vim.api.nvim_buf_set_option(scratch.buffer, "buflisted", true)
1818
end
1919

2020
function scratch.append(cmd)

0 commit comments

Comments
 (0)