mirror of
https://github.com/neovim/neovim.git
synced 2026-08-19 13:51:48 +00:00
docs(api): buffer columns are byte indices #41137
This commit is contained in:
@@ -146,7 +146,8 @@ Special types (msgpack EXT) ~
|
||||
|
||||
*api-indexing*
|
||||
Most of the API uses 0-based indices, and ranges are end-exclusive. For the
|
||||
end of a range, -1 denotes the last line/column. See |vim.pos|, |vim.range|
|
||||
end of a range, -1 denotes the last line/column. A column in buffer text is a
|
||||
byte index, not a character index or screen cell. See |vim.pos|, |vim.range|
|
||||
for representing and converting positions.
|
||||
|
||||
Exception: the following API functions use "mark-like" indexing (1-based
|
||||
|
||||
@@ -442,8 +442,9 @@ Lua module: vim.diagnostic *diagnostic-api*
|
||||
|
||||
*diagnostic-structure*
|
||||
|
||||
Diagnostics use |api-indexing| (i.e. 0-based rows and columns). See also
|
||||
|vim.pos| and |vim.range| to convert positions from other systems.
|
||||
Diagnostics use |api-indexing| (i.e. 0-based rows, and columns given as
|
||||
0-based byte indices). See also |vim.pos| and |vim.range| to convert
|
||||
positions from other systems.
|
||||
|
||||
Fields: ~
|
||||
• {bufnr} (`integer`) Buffer number
|
||||
@@ -458,7 +459,7 @@ Lua module: vim.diagnostic *diagnostic-api*
|
||||
|
||||
*vim.Diagnostic.Set*
|
||||
Diagnostics use the same indexing as the rest of the Nvim API (i.e.
|
||||
0-based rows and columns). |api-indexing|
|
||||
0-based rows, and columns given as 0-based byte indices). |api-indexing|
|
||||
|
||||
Fields: ~
|
||||
• {code}? (`string|integer`) The diagnostic code
|
||||
|
||||
@@ -14,7 +14,7 @@ local M = vim._defer_require('vim.diagnostic', {
|
||||
})
|
||||
|
||||
--- Diagnostics use the same indexing as the rest of the Nvim API (i.e. 0-based
|
||||
--- rows and columns). |api-indexing|
|
||||
--- rows, and columns given as 0-based byte indices). |api-indexing|
|
||||
--- @class vim.Diagnostic.Set
|
||||
---
|
||||
--- The starting line of the diagnostic (0-indexed)
|
||||
@@ -52,8 +52,8 @@ local M = vim._defer_require('vim.diagnostic', {
|
||||
|
||||
--- [diagnostic-structure]()
|
||||
---
|
||||
--- Diagnostics use |api-indexing| (i.e. 0-based rows and columns). See also |vim.pos| and
|
||||
--- |vim.range| to convert positions from other systems.
|
||||
--- Diagnostics use |api-indexing| (i.e. 0-based rows, and columns given as 0-based byte
|
||||
--- indices). See also |vim.pos| and |vim.range| to convert positions from other systems.
|
||||
---
|
||||
--- @class vim.Diagnostic : vim.Diagnostic.Set
|
||||
--- @field bufnr integer Buffer number
|
||||
|
||||
Reference in New Issue
Block a user