aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-04-01 22:32:16 +0200
committerJustin M. Keyes <justinkz@gmail.com>2017-04-01 23:29:10 +0200
commit3a69dbfca6642463ca8e19f814f71791f66332f3 (patch)
treef78118b0537e3965859bd6449d306c0f3ab88277 /src
parentc2826a7830ddba66261afdf45fcf4d0043506342 (diff)
downloadrneovim-3a69dbfca6642463ca8e19f814f71791f66332f3.tar.gz
rneovim-3a69dbfca6642463ca8e19f814f71791f66332f3.tar.bz2
rneovim-3a69dbfca6642463ca8e19f814f71791f66332f3.zip
api/cursor_style_set: mode descriptions
Diffstat (limited to 'src')
-rw-r--r--src/nvim/cursor_shape.c44
-rw-r--r--src/nvim/cursor_shape.h4
-rw-r--r--src/nvim/tui/tui.c4
3 files changed, 21 insertions, 31 deletions
diff --git a/src/nvim/cursor_shape.c b/src/nvim/cursor_shape.c
index c78bcbc29d..7ec70bb724 100644
--- a/src/nvim/cursor_shape.c
+++ b/src/nvim/cursor_shape.c
@@ -13,35 +13,25 @@
/// Handling of cursor and mouse pointer shapes in various modes.
static cursorentry_T shape_table[SHAPE_IDX_COUNT] =
{
- // The values will be filled in from the 'guicursor' and 'mouseshape'
- // defaults when Vim starts.
- // Adjust the SHAPE_IDX_ defines when making changes!
- { "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 },
- { "cmd_normal",
- 0, 0, 0, 700L, 400L, 250L, 0, 0, "c", SHAPE_CURSOR+SHAPE_MOUSE },
- { "cmd_insert", 0,
- 0, 0, 700L, 400L, 250L, 0, 0, "ci", SHAPE_CURSOR+SHAPE_MOUSE },
- { "cmd_replace",
- 0, 0, 0, 700L, 400L, 250L, 0, 0, "cr", SHAPE_CURSOR+SHAPE_MOUSE },
- { "pending",
- 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 },
- { "cmd_line", 0, 0, 0, 0L, 0L, 0L, 0, 0, "e", SHAPE_MOUSE },
- { "statusline", 0, 0, 0, 0L, 0L, 0L, 0, 0, "s", SHAPE_MOUSE },
- { "drag_statusline", 0, 0, 0, 0L, 0L, 0L, 0, 0, "sd", SHAPE_MOUSE },
- { "vsep", 0, 0, 0, 0L, 0L, 0L, 0, 0, "vs", SHAPE_MOUSE },
- { "vdrag", 0, 0, 0, 0L, 0L, 0L, 0, 0, "vd", SHAPE_MOUSE },
+ // Values are set by 'guicursor' and 'mouseshape'.
+ // Adjust the SHAPE_IDX_ defines when changing this!
+ { "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 },
- { "match_paren", 0, 0, 0, 100L, 100L, 100L, 0, 0, "sm", SHAPE_CURSOR },
+ { "showmatch", 0, 0, 0, 100L, 100L, 100L, 0, 0, "sm", SHAPE_CURSOR },
};
/// Converts cursor_shapes into a Dictionary of dictionaries
diff --git a/src/nvim/cursor_shape.h b/src/nvim/cursor_shape.h
index 14ace2a861..0006ede31d 100644
--- a/src/nvim/cursor_shape.h
+++ b/src/nvim/cursor_shape.h
@@ -14,9 +14,9 @@ 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, ///< On status line
SHAPE_IDX_SDRAG = 11, ///< dragging a status line
-SHAPE_IDX_VSEP = 12, ///< A vertical separator line
+SHAPE_IDX_VSEP = 12, ///< On vertical separator line
SHAPE_IDX_VDRAG = 13, ///< dragging a vertical separator line
SHAPE_IDX_MORE = 14, ///< Hit-return or More
SHAPE_IDX_MOREL = 15, ///< Hit-return or More in last line
diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c
index e1fec0f678..badc0cd870 100644
--- a/src/nvim/tui/tui.c
+++ b/src/nvim/tui/tui.c
@@ -487,7 +487,7 @@ static void tui_cursor_style_set(UI *ui, Dictionary args)
data->cursor_shapes[mode_id] = r;
}
- // force redrawal
+ // force redraw
MouseMode cursor_mode = tui_mode2cursor(data->showing_mode);
tui_set_cursor(ui, cursor_mode);
}
@@ -550,7 +550,7 @@ static void tui_set_cursor(UI *ui, MouseMode mode)
default: WLOG("Unknown shape value %d", shape); break;
}
data->params[0].i = shape;
- data->params[1].i = (c.blinkon ==0);
+ data->params[1].i = (c.blinkon == 0);
unibi_format(vars, vars + 26,
TMUX_WRAP("\x1b]50;CursorShape=%p1%d;BlinkingCursorEnabled=%p2%d\x07"),