diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-09-13 19:32:06 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-13 19:32:06 -0700 |
commit | 9cf8cf605d85ec043d4e39f73ac42c7482c6f901 (patch) | |
tree | b0a8ec8985c5bdfb1882ee847ff64b42c98d3e0a /src/nvim/cursor_shape.c | |
parent | 427cf16e44d047c14e0ca1b95eb09fc8b8eb2f3d (diff) | |
parent | 6aae0e7c943267d2109ae20ec5086791c3b94a5e (diff) | |
download | rneovim-9cf8cf605d85ec043d4e39f73ac42c7482c6f901.tar.gz rneovim-9cf8cf605d85ec043d4e39f73ac42c7482c6f901.tar.bz2 rneovim-9cf8cf605d85ec043d4e39f73ac42c7482c6f901.zip |
Merge #11015 from justinmk/getdigits
getdigits: introduce `strict`, `def` parameters
Diffstat (limited to 'src/nvim/cursor_shape.c')
-rw-r--r-- | src/nvim/cursor_shape.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/nvim/cursor_shape.c b/src/nvim/cursor_shape.c index 9c8128db4f..3f06340611 100644 --- a/src/nvim/cursor_shape.c +++ b/src/nvim/cursor_shape.c @@ -176,15 +176,17 @@ char_u *parse_shape_opt(int what) p += len; if (!ascii_isdigit(*p)) return (char_u *)N_("E548: digit expected"); - int n = getdigits_int(&p); - if (len == 3) { /* "ver" or "hor" */ - if (n == 0) + int n = getdigits_int(&p, false, 0); + if (len == 3) { // "ver" or "hor" + if (n == 0) { return (char_u *)N_("E549: Illegal percentage"); + } if (round == 2) { - if (TOLOWER_ASC(i) == 'v') + if (TOLOWER_ASC(i) == 'v') { shape_table[idx].shape = SHAPE_VER; - else + } else { shape_table[idx].shape = SHAPE_HOR; + } shape_table[idx].percentage = n; } } else if (round == 2) { |