aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/cursor_shape.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-04-18 21:40:14 +0200
committerGitHub <noreply@github.com>2022-04-18 21:40:14 +0200
commitd3121f1e6380822fcc284ba374b5854c655a1dc4 (patch)
tree8f2e1dca03bc71f8b71ab972dc7dacfe12c03386 /src/nvim/cursor_shape.c
parente73ef5c09281fa45ce6b0a0959467722af2840e8 (diff)
parent0fb571e3b5043f136f2394d84b942b8c93fdde45 (diff)
downloadrneovim-d3121f1e6380822fcc284ba374b5854c655a1dc4.tar.gz
rneovim-d3121f1e6380822fcc284ba374b5854c655a1dc4.tar.bz2
rneovim-d3121f1e6380822fcc284ba374b5854c655a1dc4.zip
Merge pull request #18091 from dundargoc/refactor/pure-attribute
refactor: add pure attribute to pure functions
Diffstat (limited to 'src/nvim/cursor_shape.c')
-rw-r--r--src/nvim/cursor_shape.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nvim/cursor_shape.c b/src/nvim/cursor_shape.c
index 0e4a4bcfb0..73adff6579 100644
--- a/src/nvim/cursor_shape.c
+++ b/src/nvim/cursor_shape.c
@@ -277,6 +277,7 @@ char *parse_shape_opt(int what)
///
/// @param exclusive If 'selection' option is "exclusive".
bool cursor_is_block_during_visual(bool exclusive)
+ FUNC_ATTR_PURE
{
int mode_idx = exclusive ? SHAPE_IDX_VE : SHAPE_IDX_V;
return (SHAPE_BLOCK == shape_table[mode_idx].shape
@@ -300,6 +301,7 @@ int cursor_mode_str2int(const char *mode)
/// Check if a syntax id is used as a cursor style.
bool cursor_mode_uses_syn_id(int syn_id)
+ FUNC_ATTR_PURE
{
if (*p_guicursor == NUL) {
return false;
@@ -316,6 +318,7 @@ bool cursor_mode_uses_syn_id(int syn_id)
/// Return the index into shape_table[] for the current mode.
int cursor_get_mode_idx(void)
+ FUNC_ATTR_PURE
{
if (State == SHOWMATCH) {
return SHAPE_IDX_SM;