diff --git a/.github/workflows/docgen.yml b/.github/workflows/docgen.yml index 0401279..dbb729f 100644 --- a/.github/workflows/docgen.yml +++ b/.github/workflows/docgen.yml @@ -13,13 +13,13 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-22.04 + - os: ubuntu-24.04 url: https://github.com/neovim/neovim/releases/download/nightly/nvim-linux64.tar.gz steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: date +%F > todays-date - name: Restore cache for today's nightly. - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: _neovim key: ${{ runner.os }}-${{ matrix.url }}-${{ hashFiles('todays-date') }} diff --git a/doc/macrothis.txt b/doc/macrothis.txt index 1c8b287..1014bf0 100644 --- a/doc/macrothis.txt +++ b/doc/macrothis.txt @@ -3,7 +3,7 @@ *macrothis.nvim* Macrothis.nvim is a plugin for saving and loading registers/macros -Usage~ +Usage ~ Using Lazy plugin manager { "desdic/macrothis.nvim", @@ -74,7 +74,7 @@ Using Lazy plugin manager `macrothis.save`() Save a macro/register -Usage~ +Usage ~ `require('macrothis').save()` ------------------------------------------------------------------------------ @@ -82,7 +82,7 @@ Usage~ `macrothis.load`() Load a macro/register -Usage~ +Usage ~ `require('macrothis').load()` ------------------------------------------------------------------------------ @@ -90,7 +90,7 @@ Usage~ `macrothis.delete`() Delete a macro/register -Usage~ +Usage ~ `require('macrothis').delete()` ------------------------------------------------------------------------------ @@ -98,7 +98,7 @@ Usage~ `macrothis.run`() Run macro -Usage~ +Usage ~ `require('macrothis').run()` ------------------------------------------------------------------------------ @@ -106,7 +106,7 @@ Usage~ `macrothis.quickfix`() Run macro on all in quickfix list -Usage~ +Usage ~ `require('macrothis').quickfix()` ------------------------------------------------------------------------------ @@ -114,7 +114,7 @@ Usage~ `macrothis.edit`() Edit macro -Usage~ +Usage ~ `require('macrothis').edit()` ------------------------------------------------------------------------------ @@ -122,7 +122,7 @@ Usage~ `macrothis.rename`() Rename macro -Usage~ +Usage ~ `require('macrothis').rename()` ------------------------------------------------------------------------------ @@ -130,7 +130,7 @@ Usage~ `macrothis.register`() Modify register -Usage~ +Usage ~ require('macrothis').register() ------------------------------------------------------------------------------ @@ -138,7 +138,7 @@ require('macrothis').register() `macrothis.copy_register_printable`() Copy register as printable -Usage~ +Usage ~ require('macrothis').copy_register_printable() ------------------------------------------------------------------------------ @@ -146,7 +146,7 @@ require('macrothis').copy_register_printable() `macrothis.copy_macro_printable`() Copy macro as printable -Usage~ +Usage ~ require('macrothis').copy_macro_printable() ------------------------------------------------------------------------------ diff --git a/lua/macrothis/utils.lua b/lua/macrothis/utils.lua index 5727328..d772625 100644 --- a/lua/macrothis/utils.lua +++ b/lua/macrothis/utils.lua @@ -115,8 +115,8 @@ utils.create_edit_register = function(register) vim.api.nvim_buf_set_lines(bufnr, 0, 0, true, { entrycontent }) - vim.api.nvim_buf_set_option(bufnr, "modifiable", true) - vim.api.nvim_buf_set_option(bufnr, "buftype", "nofile") + vim.api.nvim_set_option_value("modifiable", true, { buf = bufnr }) + vim.api.nvim_set_option_value("buftype", "nofile", { buf = bufnr }) vim.api.nvim_buf_set_name(bufnr, "editing " .. register) vim.api.nvim_create_autocmd({ "BufWinLeave" }, { @@ -124,14 +124,14 @@ utils.create_edit_register = function(register) local bufcontent = vim.api.nvim_buf_get_lines(bufopts.buf, 0, -1, true) - bufcontent = table.concat(bufcontent, "") + local bbufcontent = table.concat(bufcontent, "") -- Re-add newlines - local newcontent = bufcontent:gsub("\\n", "\n") + local newcontent = bbufcontent:gsub("\\n", "\n") vim.fn.setreg(register, newcontent, entrytype) - vim.api.nvim_buf_set_option(bufnr, "modifiable", false) + vim.api.nvim_set_option_value("modifiable", false, { buf = bufnr }) vim.api.nvim_win_close(0, true) vim.schedule(function() vim.cmd("bdelete! " .. bufnr) @@ -159,8 +159,8 @@ utils.create_edit_window = function(opts, description) vim.api.nvim_buf_set_lines(bufnr, 0, 0, true, { entrycontent }) - vim.api.nvim_buf_set_option(bufnr, "modifiable", true) - vim.api.nvim_buf_set_option(bufnr, "buftype", "nofile") + vim.api.nvim_set_option_value("modifiable", true, { buf = bufnr }) + vim.api.nvim_set_option_value("buftype", "nofile", { buf = bufnr }) vim.api.nvim_buf_set_name(bufnr, entrylabel) vim.api.nvim_create_autocmd({ "BufWinLeave" }, { @@ -168,15 +168,15 @@ utils.create_edit_window = function(opts, description) local bufcontent = vim.api.nvim_buf_get_lines(bufopts.buf, 0, -1, true) - bufcontent = table.concat(bufcontent, "") + local bbufcontent = table.concat(bufcontent, "") -- Re-add newlines - local newcontent = bufcontent:gsub("\\n", "\n") + local newcontent = bbufcontent:gsub("\\n", "\n") vim.fn.setreg(opts.run_register, newcontent, entrytype) utils.store_register(opts, opts.run_register, entrylabel) - vim.api.nvim_buf_set_option(bufnr, "modifiable", false) + vim.api.nvim_set_option_value("modifiable", false, { buf = bufnr }) vim.api.nvim_win_close(0, true) vim.schedule(function() vim.cmd("bdelete! " .. bufnr) diff --git a/lua/telescope/_extensions/macrothis.lua b/lua/telescope/_extensions/macrothis.lua index 098836b..e3f563c 100644 --- a/lua/telescope/_extensions/macrothis.lua +++ b/lua/telescope/_extensions/macrothis.lua @@ -370,14 +370,17 @@ local help = function(prompt_bufnr) end local bufnr = vim.api.nvim_create_buf(false, false) - vim.api.nvim_buf_set_option(bufnr, "buftype", "nofile") - vim.api.nvim_buf_set_option(bufnr, "filetype", "macrothishelp") - vim.api.nvim_buf_set_option(bufnr, "bufhidden", "wipe") - vim.api.nvim_buf_set_option(bufnr, "swapfile", false) + + local options = { buf = bufnr } + + vim.api.nvim_set_option_value("buftype", "nofile", options) + vim.api.nvim_set_option_value("filetype", "macrothishelp", options) + vim.api.nvim_set_option_value("bufhidden", "wipe", options) + vim.api.nvim_set_option_value("swapfile", false, options) vim.api.nvim_buf_set_lines(bufnr, 0, -1, true, entries) - vim.api.nvim_buf_set_option(bufnr, "modifiable", false) + vim.api.nvim_set_option_value("modifiable", false, options) opts.style = "minimal" opts.zindex = 200