diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-04-01 13:08:42 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-04-01 23:14:05 +0200 |
commit | c2826a7830ddba66261afdf45fcf4d0043506342 (patch) | |
tree | d979ef9ee3169e1c0e1c8909390dd9f2502a7ed8 /src | |
parent | 54bab0019b3638f213608757b523062195be156b (diff) | |
download | rneovim-c2826a7830ddba66261afdf45fcf4d0043506342.tar.gz rneovim-c2826a7830ddba66261afdf45fcf4d0043506342.tar.bz2 rneovim-c2826a7830ddba66261afdf45fcf4d0043506342.zip |
'guicursor': Empty means "block cursor in all modes".
Also: update default 'guicursor' to match the documentation.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/cursor_shape.c | 13 | ||||
-rw-r--r-- | src/nvim/cursor_shape.h | 4 | ||||
-rw-r--r-- | src/nvim/options.lua | 2 | ||||
-rw-r--r-- | src/nvim/tui/tui.c | 1 |
4 files changed, 10 insertions, 10 deletions
diff --git a/src/nvim/cursor_shape.c b/src/nvim/cursor_shape.c index 9f0eb215ef..c78bcbc29d 100644 --- a/src/nvim/cursor_shape.c +++ b/src/nvim/cursor_shape.c @@ -45,7 +45,7 @@ static cursorentry_T shape_table[SHAPE_IDX_COUNT] = }; /// Converts cursor_shapes into a Dictionary of dictionaries -/// @return a dictionary of the form {"normal" : { "cursor_shape": ... }, ...} +/// @return dictionary of the form {"normal" : { "cursor_shape": ... }, ...} Dictionary cursor_shape_dict(void) { Dictionary all = ARRAY_DICT_INIT; @@ -82,7 +82,7 @@ Dictionary cursor_shape_dict(void) /// Parse the 'guicursor' option /// -/// @param what either SHAPE_CURSOR or SHAPE_MOUSE ('mouseshape') +/// @param what SHAPE_CURSOR or SHAPE_MOUSE ('mouseshape') /// /// @returns error message for an illegal option, NULL otherwise. char_u *parse_shape_opt(int what) @@ -103,10 +103,11 @@ char_u *parse_shape_opt(int what) * First round: check for errors; second round: do it for real. */ for (round = 1; round <= 2; ++round) { - /* - * Repeat for all comma separated parts. - */ + // Repeat for all comma separated parts. modep = p_guicursor; + if (*p_guicursor == NUL) { + modep = (char_u *)"a:block-blinkon0"; + } while (*modep != NUL) { colonp = vim_strchr(modep, ':'); if (colonp == NULL) @@ -115,7 +116,7 @@ char_u *parse_shape_opt(int what) return (char_u *)N_("E546: Illegal mode"); commap = vim_strchr(modep, ','); - // Repeat for all mode's before the colon. + // Repeat for all modes before the colon. // For the 'a' mode, we loop to handle all the modes. all_idx = -1; assert(modep < colonp); diff --git a/src/nvim/cursor_shape.h b/src/nvim/cursor_shape.h index 127d0df555..14ace2a861 100644 --- a/src/nvim/cursor_shape.h +++ b/src/nvim/cursor_shape.h @@ -14,7 +14,7 @@ SHAPE_IDX_CR = 6, ///< Command line Replace mode SHAPE_IDX_O = 7, ///< Operator-pending mode SHAPE_IDX_VE = 8, ///< Visual mode with 'selection' exclusive SHAPE_IDX_CLINE = 9, ///< On command line -SHAPE_IDX_STATUS = 10, ///< status line +SHAPE_IDX_STATUS = 10, ///< status line SHAPE_IDX_SDRAG = 11, ///< dragging a status line SHAPE_IDX_VSEP = 12, ///< A vertical separator line SHAPE_IDX_VDRAG = 13, ///< dragging a vertical separator line @@ -37,7 +37,7 @@ SHAPE_VER = 2 ///< vertical bar cursor #define SHAPE_CURSOR 2 /* used for text cursor shape */ typedef struct cursor_entry { - char *full_name; ///< mode full name + char *full_name; ///< mode description CursorShape shape; ///< cursor shape: one of the SHAPE_ defines int mshape; ///< mouse shape: one of the MSHAPE defines int percentage; ///< percentage of cell for bar diff --git a/src/nvim/options.lua b/src/nvim/options.lua index 9dff3410d6..09f016cf5a 100644 --- a/src/nvim/options.lua +++ b/src/nvim/options.lua @@ -1000,7 +1000,7 @@ return { deny_duplicates=true, vi_def=true, varname='p_guicursor', - defaults={if_true={vi="n-v-c:block,o:hor50,i-ci:hor15,r-cr:hor30,sm:block"}} + defaults={if_true={vi="n-v-c:block-Cursor/lCursor,ve:ver35-Cursor,o:hor50-Cursor,i-ci:ver25-Cursor/lCursor,r-cr:hor20-Cursor/lCursor,sm:block-Cursor-blinkwait175-blinkoff150-blinkon175"}} }, { full_name='guifont', abbreviation='gfn', diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 12281246fe..e1fec0f678 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -148,7 +148,6 @@ static void terminfo_start(UI *ui) data->ut = unibi_dummy(); } fix_terminfo(data); - // Initialize the cursor shape. // Set 't_Co' from the result of unibilium & fix_terminfo. t_colors = unibi_get_num(data->ut, unibi_max_colors); // Enter alternate screen and clear |