diff options
author | Famiu Haque <famiuhaque@proton.me> | 2023-12-17 05:23:33 +0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-17 07:23:33 +0800 |
commit | 8f08b1efbd096850c04c2e8e2890d993bd4d9f95 (patch) | |
tree | 2fa91d7a39c1c82e9b6d0c578d74f17bb80b1827 /src/nvim/statusline.c | |
parent | 2b1bc94b768cb13801e7166f6b02bd09caa3c18f (diff) | |
download | rneovim-8f08b1efbd096850c04c2e8e2890d993bd4d9f95.tar.gz rneovim-8f08b1efbd096850c04c2e8e2890d993bd4d9f95.tar.bz2 rneovim-8f08b1efbd096850c04c2e8e2890d993bd4d9f95.zip |
refactor(options): use hashy for finding options (#26573)
Problem:
`findoption()` searches through the options[] table linearly for option
names, even though hashy can be used to generate a compile-time hash
table for it.
Solution:
Use hashy to generate a compile time hash table for finding options.
This also allows handling option aliases, so we don't need separate
options[] table entries for things like 'viminfo'.
Diffstat (limited to 'src/nvim/statusline.c')
-rw-r--r-- | src/nvim/statusline.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/statusline.c b/src/nvim/statusline.c index c7d9a65b86..f4ffa2a6b8 100644 --- a/src/nvim/statusline.c +++ b/src/nvim/statusline.c @@ -1545,7 +1545,7 @@ int build_stl_str_hl(win_T *wp, char *out, size_t outlen, char *fmt, OptIndex op break; case STL_SHOWCMD: - if (p_sc && (opt_idx == kOptInvalid || findoption(p_sloc) == opt_idx)) { + if (p_sc && (opt_idx == kOptInvalid || find_option(p_sloc) == opt_idx)) { str = showcmd_buf; } break; |