diff options
author | Lewis Russell <lewis6991@gmail.com> | 2023-01-25 13:46:23 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-25 13:46:23 +0000 |
commit | e2a9d71521a1acdc5a554e3d9f54dfe543914db5 (patch) | |
tree | 07b5ac97f4770df35d8cf412b0a9c24f8c3a576d /src/nvim/ex_getln.c | |
parent | b8288df99be8df701308167e4b0b497f003f25e9 (diff) | |
parent | 7bee622fdc72d7461ed43ea170cca20056891d2c (diff) | |
download | rneovim-e2a9d71521a1acdc5a554e3d9f54dfe543914db5.tar.gz rneovim-e2a9d71521a1acdc5a554e3d9f54dfe543914db5.tar.bz2 rneovim-e2a9d71521a1acdc5a554e3d9f54dfe543914db5.zip |
Merge pull request #21885 from lewis6991/refactor/options
Problems:
- Scope of local variables in options code is too large.
- did_set_string_option() is too large (>1000LOC).
- Setting options for a particular window or buffer requires a changing context (assigning curwin/curbuf).
Solutions:
- Reduce the scope of local variables.
- Break up did_set_string_option so it doesn't contain specific logic about each individual option (1038 LOC -> 310 LOC).
- Begin work on making functions not depend on curbuf or curwin and pass window or buffer handles explicitly.
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r-- | src/nvim/ex_getln.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index c62142310d..76c3680742 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -1557,9 +1557,9 @@ static void command_line_toggle_langmap(CommandLineState *s) if (s->b_im_ptr != NULL) { if (s->b_im_ptr == &curbuf->b_p_iminsert) { - set_iminsert_global(); + set_iminsert_global(curbuf); } else { - set_imsearch_global(); + set_imsearch_global(curbuf); } } ui_cursor_shape(); // may show different cursor shape |