Functions | Variables
cursor_shape.c File Reference
#include <assert.h>
#include <stdint.h>
#include "nvim/vim.h"
#include "nvim/ascii.h"
#include "nvim/cursor_shape.h"
#include "nvim/ex_getln.h"
#include "nvim/charset.h"
#include "nvim/strings.h"
#include "nvim/syntax.h"
#include "nvim/api/private/helpers.h"
#include "nvim/ui.h"

Functions

Array mode_style_array (void)
 
char_uparse_shape_opt (int what)
 
bool cursor_is_block_during_visual (bool exclusive)
 
int cursor_mode_str2int (const char *mode)
 
bool cursor_mode_uses_syn_id (int syn_id)
 Check if a syntax id is used as a cursor style. More...
 
int cursor_get_mode_idx (void)
 Return the index into shape_table[] for the current mode. More...
 

Variables

cursorentry_T shape_table [SHAPE_IDX_COUNT]
 Handling of cursor and mouse pointer shapes in various modes. More...
 

Function Documentation

int cursor_get_mode_idx ( void  )

Return the index into shape_table[] for the current mode.

bool cursor_is_block_during_visual ( bool  exclusive)

Returns true if the cursor is non-blinking "block" shape during visual selection.

Parameters
exclusiveIf 'selection' option is "exclusive".
int cursor_mode_str2int ( const char *  mode)

Map cursor mode from string to integer

Parameters
modeFullname of the mode whose id we are looking for
Returns
-1 in case of failure, else the matching SHAPE_ID* integer
bool cursor_mode_uses_syn_id ( int  syn_id)

Check if a syntax id is used as a cursor style.

Array mode_style_array ( void  )

Converts cursor_shapes into an Array of Dictionaries

Returns
Array of the form {[ "cursor_shape": ... ], ...}
char_u* parse_shape_opt ( int  what)

Parse the 'guicursor' option

Parameters
whatSHAPE_CURSOR or SHAPE_MOUSE ('mouseshape')
Returns
error message for an illegal option, NULL otherwise.

Variable Documentation

Initial value:
=
{
{ "normal", 0, 0, 0, 700L, 400L, 250L, 0, 0, "n", SHAPE_CURSOR+SHAPE_MOUSE },
{ "visual", 0, 0, 0, 700L, 400L, 250L, 0, 0, "v", SHAPE_CURSOR+SHAPE_MOUSE },
{ "insert", 0, 0, 0, 700L, 400L, 250L, 0, 0, "i", SHAPE_CURSOR+SHAPE_MOUSE },
{ "replace", 0, 0, 0, 700L, 400L, 250L, 0, 0, "r", SHAPE_CURSOR+SHAPE_MOUSE },
{ "cmdline_normal", 0, 0, 0, 700L, 400L, 250L, 0, 0, "c", SHAPE_CURSOR+SHAPE_MOUSE },
{ "cmdline_insert", 0, 0, 0, 700L, 400L, 250L, 0, 0, "ci", SHAPE_CURSOR+SHAPE_MOUSE },
{ "cmdline_replace", 0, 0, 0, 700L, 400L, 250L, 0, 0, "cr", SHAPE_CURSOR+SHAPE_MOUSE },
{ "operator", 0, 0, 0, 700L, 400L, 250L, 0, 0, "o", SHAPE_CURSOR+SHAPE_MOUSE },
{ "visual_select", 0, 0, 0, 700L, 400L, 250L, 0, 0, "ve", SHAPE_CURSOR+SHAPE_MOUSE },
{ "cmdline_hover", 0, 0, 0, 0L, 0L, 0L, 0, 0, "e", SHAPE_MOUSE },
{ "statusline_hover", 0, 0, 0, 0L, 0L, 0L, 0, 0, "s", SHAPE_MOUSE },
{ "statusline_drag", 0, 0, 0, 0L, 0L, 0L, 0, 0, "sd", SHAPE_MOUSE },
{ "vsep_hover", 0, 0, 0, 0L, 0L, 0L, 0, 0, "vs", SHAPE_MOUSE },
{ "vsep_drag", 0, 0, 0, 0L, 0L, 0L, 0, 0, "vd", SHAPE_MOUSE },
{ "more", 0, 0, 0, 0L, 0L, 0L, 0, 0, "m", SHAPE_MOUSE },
{ "more_lastline", 0, 0, 0, 0L, 0L, 0L, 0, 0, "ml", SHAPE_MOUSE },
{ "showmatch", 0, 0, 0, 100L, 100L, 100L, 0, 0, "sm", SHAPE_CURSOR },
}
#define SHAPE_CURSOR
Definition: cursor_shape.h:40
#define SHAPE_MOUSE
Definition: cursor_shape.h:39

Handling of cursor and mouse pointer shapes in various modes.