docs: fix erroneous nvim_buf_set_extmark example (#23404)

This commit is contained in:
luukvbaal 2023-04-30 14:36:54 +02:00 committed by GitHub
parent 4f3f81ed86
commit 064bf39c46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -408,13 +408,13 @@ id. Thus, instead of >lua
<
use >lua
-- create the highlight through an extmark
extid = vim.api.nvim_buf_set_extmark(buf, ns_id, hl_group, line, col_start, {end_col = col_end, hl_group = hl_group})
extid = vim.api.nvim_buf_set_extmark(buf, ns_id, line, col_start, {end_col = col_end, hl_group = hl_group})
-- example: modify the extmark's highlight group
vim.api.nvim_buf_set_extmark(buf, ns_id, NEW_HL_GROUP, line, col_start, {end_col = col_end, hl_group = hl_group, id = extid})
-- example: change the highlight's position
vim.api.nvim_buf_set_extmark(buf, ns_id, hl_group, NEW_LINE, col_start, {end_col = col_end, hl_group = hl_group, id = extid})
vim.api.nvim_buf_set_extmark(buf, ns_id, NEW_LINE, col_start, {end_col = col_end, hl_group = NEW_HL_GROUP, id = extid})
<
Example using the Python API client (|pynvim|):