diff options
Diffstat (limited to 'runtime/plugin')
-rw-r--r-- | runtime/plugin/matchparen.vim | 8 | ||||
-rw-r--r-- | runtime/plugin/tohtml.lua | 4 |
2 files changed, 4 insertions, 8 deletions
diff --git a/runtime/plugin/matchparen.vim b/runtime/plugin/matchparen.vim index 6c061c9fb8..2899612dce 100644 --- a/runtime/plugin/matchparen.vim +++ b/runtime/plugin/matchparen.vim @@ -60,12 +60,8 @@ func s:Highlight_Matching_Pair() let before = 0 let text = getline(c_lnum) - let matches = matchlist(text, '\(.\)\=\%'.c_col.'c\(.\=\)') - if empty(matches) - let [c_before, c] = ['', ''] - else - let [c_before, c] = matches[1:2] - endif + let c_before = text->strpart(0, c_col - 1)->slice(-1) + let c = text->strpart(c_col - 1)->slice(0, 1) let plist = split(&matchpairs, '.\zs[:,]') let i = index(plist, c) if i < 0 diff --git a/runtime/plugin/tohtml.lua b/runtime/plugin/tohtml.lua index 79f2794a40..0cb4562938 100644 --- a/runtime/plugin/tohtml.lua +++ b/runtime/plugin/tohtml.lua @@ -5,8 +5,8 @@ vim.g.loaded_2html_plugin = true vim.api.nvim_create_user_command('TOhtml', function(args) local outfile = args.args ~= '' and args.args or vim.fn.tempname() .. '.html' - local html = require('tohtml').tohtml() + local html = require('tohtml').tohtml(0, { range = { args.line1, args.line2 } }) vim.fn.writefile(html, outfile) vim.cmd.split(outfile) vim.bo.filetype = 'html' -end, { bar = true, nargs = '?' }) +end, { bar = true, nargs = '?', range = '%' }) |