Functions
deprecated.c File Reference
#include <limits.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include "nvim/api/buffer.h"
#include "nvim/api/deprecated.h"
#include "nvim/api/extmark.h"
#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
#include "nvim/api/vim.h"
#include "nvim/api/vimscript.h"
#include "nvim/extmark.h"
#include "nvim/lua/executor.h"

Functions

String nvim_command_output (String command, Error *err) FUNC_API_DEPRECATED_SINCE(7)
 
Object nvim_execute_lua (String code, Array args, Error *err) FUNC_API_REMOTE_ONLY
 
Integer nvim_buf_get_number (Buffer buffer, Error *err) FUNC_API_DEPRECATED_SINCE(2)
 
void nvim_buf_clear_highlight (Buffer buffer, Integer ns_id, Integer line_start, Integer line_end, Error *err) FUNC_API_DEPRECATED_SINCE(7)
 
Integer nvim_buf_set_virtual_text (Buffer buffer, Integer src_id, Integer line, Array chunks, Dictionary opts, Error *err) FUNC_API_DEPRECATED_SINCE(8)
 
void buffer_insert (Buffer buffer, Integer lnum, ArrayOf(String) lines, Error *err) FUNC_API_DEPRECATED_SINCE(1)
 
String buffer_get_line (Buffer buffer, Integer index, Error *err) FUNC_API_DEPRECATED_SINCE(1)
 
void buffer_set_line (Buffer buffer, Integer index, String line, Error *err) FUNC_API_DEPRECATED_SINCE(1)
 
void buffer_del_line (Buffer buffer, Integer index, Error *err) FUNC_API_DEPRECATED_SINCE(1)
 
 ArrayOf (String)
 
void buffer_set_line_slice (Buffer buffer, Integer start, Integer end, Boolean include_start, Boolean include_end, ArrayOf(String) replacement, Error *err) FUNC_API_DEPRECATED_SINCE(1)
 
Object buffer_set_var (Buffer buffer, String name, Object value, Error *err) FUNC_API_DEPRECATED_SINCE(1)
 
Object buffer_del_var (Buffer buffer, String name, Error *err) FUNC_API_DEPRECATED_SINCE(1)
 
Object window_set_var (Window window, String name, Object value, Error *err) FUNC_API_DEPRECATED_SINCE(1)
 
Object window_del_var (Window window, String name, Error *err) FUNC_API_DEPRECATED_SINCE(1)
 
Object tabpage_set_var (Tabpage tabpage, String name, Object value, Error *err) FUNC_API_DEPRECATED_SINCE(1)
 
Object tabpage_del_var (Tabpage tabpage, String name, Error *err) FUNC_API_DEPRECATED_SINCE(1)
 
Object vim_set_var (String name, Object value, Error *err) FUNC_API_DEPRECATED_SINCE(1)
 
Object vim_del_var (String name, Error *err) FUNC_API_DEPRECATED_SINCE(1)
 

Function Documentation

◆ ArrayOf()

ArrayOf ( String  )

Retrieves a line range from the buffer

Deprecated:
use nvim_buf_get_lines(buffer, newstart, newend, false) where newstart = start + int(not include_start) - int(start < 0) newend = end + int(include_end) - int(end < 0) int(bool) = 1 if bool is true else 0
Parameters
bufferBuffer handle
startFirst line index
endLast line index
include_startTrue if the slice includes the start parameter
include_endTrue if the slice includes the end parameter
[out]errError details, if any
Returns
Array of lines

◆ buffer_del_line()

void buffer_del_line ( Buffer  buffer,
Integer  index,
Error err 
)

Deletes a buffer line

Deprecated:
use nvim_buf_set_lines instead. for positive indices use "nvim_buf_set_lines(buffer, index, index+1, true, [])" for negative indices use "nvim_buf_set_lines(buffer, index-1, index, true, [])"
Parameters
bufferbuffer handle
indexline index
[out]errError details, if any

◆ buffer_del_var()

Object buffer_del_var ( Buffer  buffer,
String  name,
Error err 
)

Removes a buffer-scoped (b:) variable

Deprecated:
Parameters
bufferBuffer handle, or 0 for current buffer
nameVariable name
[out]errError details, if any
Returns
Old value

◆ buffer_get_line()

String buffer_get_line ( Buffer  buffer,
Integer  index,
Error err 
)

Gets a buffer line

Deprecated:
use nvim_buf_get_lines instead. for positive indices (including 0) use "nvim_buf_get_lines(buffer, index, index+1, true)" for negative indices use "nvim_buf_get_lines(buffer, index-1, index, true)"
Parameters
bufferBuffer handle
indexLine index
[out]errError details, if any
Returns
Line string

◆ buffer_insert()

void buffer_insert ( Buffer  buffer,
Integer  lnum,
ArrayOf(String lines,
Error err 
)

Inserts a sequence of lines to a buffer at a certain index

Deprecated:
use nvim_buf_set_lines(buffer, lnum, lnum, true, lines)
Parameters
bufferBuffer handle
lnumInsert the lines after lnum. If negative, appends to the end of the buffer.
linesArray of lines
[out]errError details, if any

◆ buffer_set_line()

void buffer_set_line ( Buffer  buffer,
Integer  index,
String  line,
Error err 
)

Sets a buffer line

Deprecated:
use nvim_buf_set_lines instead. for positive indices use "nvim_buf_set_lines(buffer, index, index+1, true, [line])" for negative indices use "nvim_buf_set_lines(buffer, index-1, index, true, [line])"
Parameters
bufferBuffer handle
indexLine index
lineContents of the new line
[out]errError details, if any

◆ buffer_set_line_slice()

void buffer_set_line_slice ( Buffer  buffer,
Integer  start,
Integer  end,
Boolean  include_start,
Boolean  include_end,
ArrayOf(String replacement,
Error err 
)

Replaces a line range on the buffer

Deprecated:
use nvim_buf_set_lines(buffer, newstart, newend, false, lines) where newstart = start + int(not include_start) + int(start < 0) newend = end + int(include_end) + int(end < 0) int(bool) = 1 if bool is true else 0
Parameters
bufferBuffer handle, or 0 for current buffer
startFirst line index
endLast line index
include_startTrue if the slice includes the start parameter
include_endTrue if the slice includes the end parameter
replacementArray of lines to use as replacement (0-length
[out]errError details, if any

◆ buffer_set_var()

Object buffer_set_var ( Buffer  buffer,
String  name,
Object  value,
Error err 
)

Sets a buffer-scoped (b:) variable

Deprecated:
Parameters
bufferBuffer handle, or 0 for current buffer
nameVariable name
valueVariable value
[out]errError details, if any
Returns
Old value or nil if there was no previous value.
    @warning It may return nil if there was no previous value
             or if previous value was `v:null`. 

◆ nvim_buf_clear_highlight()

void nvim_buf_clear_highlight ( Buffer  buffer,
Integer  ns_id,
Integer  line_start,
Integer  line_end,
Error err 
)

Clears highlights and virtual text from namespace and range of lines

Deprecated:
use |nvim_buf_clear_namespace()|.
Parameters
bufferBuffer handle, or 0 for current buffer
ns_idNamespace to clear, or -1 to clear all.
line_startStart of range of lines to clear
line_endEnd of range of lines to clear (exclusive) or -1 to clear to end of file.
[out]errError details, if any

◆ nvim_buf_get_number()

Integer nvim_buf_get_number ( Buffer  buffer,
Error err 
)

Gets the buffer number

Deprecated:
The buffer number now is equal to the object id, so there is no need to use this function.
Parameters
bufferBuffer handle, or 0 for current buffer
[out]errError details, if any
Returns
Buffer number

◆ nvim_buf_set_virtual_text()

Integer nvim_buf_set_virtual_text ( Buffer  buffer,
Integer  src_id,
Integer  line,
Array  chunks,
Dictionary  opts,
Error err 
)

Set the virtual text (annotation) for a buffer line.

Deprecated:
use nvim_buf_set_extmark to use full virtual text functionality.

The text will be placed after the buffer text. Virtual text will never cause reflow, rather virtual text will be truncated at the end of the screen line. The virtual text will begin one cell (|lcs-eol| or space) after the ordinary text.

Namespaces are used to support batch deletion/updating of virtual text. To create a namespace, use |nvim_create_namespace()|. Virtual text is cleared using |nvim_buf_clear_namespace()|. The same ns_id can be used for both virtual text and highlights added by |nvim_buf_add_highlight()|, both can then be cleared with a single call to |nvim_buf_clear_namespace()|. If the virtual text never will be cleared by an API call, pass ns_id = -1.

As a shorthand, ns_id = 0 can be used to create a new namespace for the virtual text, the allocated id is then returned.

Parameters
bufferBuffer handle, or 0 for current buffer
ns_idNamespace to use or 0 to create a namespace, or -1 for a ungrouped annotation
lineLine to annotate with virtual text (zero-indexed)
chunksA list of [text, hl_group] arrays, each representing a text chunk with specified highlight. hl_group element can be omitted for no highlight.
optsOptional parameters. Currently not used.
[out]errError details, if any
Returns
The ns_id that was used

◆ nvim_command_output()

String nvim_command_output ( String  command,
Error err 
)

◆ nvim_execute_lua()

Object nvim_execute_lua ( String  code,
Array  args,
Error err 
)

◆ tabpage_del_var()

Object tabpage_del_var ( Tabpage  tabpage,
String  name,
Error err 
)

Removes a tab-scoped (t:) variable

Deprecated:
Parameters
tabpageTabpage handle, or 0 for current tabpage
nameVariable name
[out]errError details, if any
Returns
Old value

◆ tabpage_set_var()

Object tabpage_set_var ( Tabpage  tabpage,
String  name,
Object  value,
Error err 
)

Sets a tab-scoped (t:) variable

Deprecated:
Parameters
tabpageTabpage handle, or 0 for current tabpage
nameVariable name
valueVariable value
[out]errError details, if any
Returns
Old value or nil if there was no previous value.
    @warning It may return nil if there was no previous value
             or if previous value was `v:null`. 

◆ vim_del_var()

Object vim_del_var ( String  name,
Error err 
)

◆ vim_set_var()

Object vim_set_var ( String  name,
Object  value,
Error err 
)
Deprecated:
See also
nvim_set_var
Warning
May return nil if there was no previous value OR if previous value was v:null.
Returns
Old value or nil if there was no previous value.

◆ window_del_var()

Object window_del_var ( Window  window,
String  name,
Error err 
)

Removes a window-scoped (w:) variable

Deprecated:
Parameters
windowWindow handle, or 0 for current window
namevariable name
[out]errError details, if any
Returns
Old value

◆ window_set_var()

Object window_set_var ( Window  window,
String  name,
Object  value,
Error err 
)

Sets a window-scoped (w:) variable

Deprecated:
Parameters
windowWindow handle, or 0 for current window
nameVariable name
valueVariable value
[out]errError details, if any
Returns
Old value or nil if there was no previous value.
    @warning It may return nil if there was no previous value
             or if previous value was `v:null`.