]> git.wincent.com - pinnacle.git/commit
refactor!: remove sub_newlines and capture_line from Lua API
authorGreg Hurrell <greg@hurrell.net>
Mon, 12 Oct 2020 14:19:57 +0000 (16:19 +0200)
committerGreg Hurrell <greg@hurrell.net>
Mon, 12 Oct 2020 14:19:57 +0000 (16:19 +0200)
commitc7ca2b8b8aaf564fc80abbdc17d17cafbe53e5fc
tree2efdb092aa63e2f66efb459a2902e5cc4f56f3d9
parent924379ee0309bf5113e5d13b42878aa198260684
refactor!: remove sub_newlines and capture_line from Lua API

Because these are ancient methods that were only added to support
ancient versions of Vim (ie. before `execute()` existed). For context,
see:

- https://github.com/wincent/wincent/commit/3b0b2950cdcb09d23c87f0167c207d8c837cb1b2
- https://github.com/wincent/wincent/commit/386edd17854e609fe9dd9736524798e7057eefe7

Back in the old days, we used to capture the output of `:highlight`
with `:redir`, and it was sensitive to terminal width, which meant that
lines could wrap and wreak havoc. In newer Vim we just use `execute()`
which is width-agnostic, and in Neovim we can be even more direct
and call `nvim_exec()`. ie. instead of going Lua to Vimscript (eg.
`vim.fn.execute`) to turn a string into a command to run, we can go from
Lua directly to running the command.
README.md
autoload/pinnacle.vim
doc/pinnacle.txt
lua/wincent/pinnacle.lua