diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-08-17 20:35:51 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-17 20:35:51 +0800 |
commit | 5a564bf242828a04c8fe12c7e83154cb09acf4aa (patch) | |
tree | aac46d05c1c14783fce95a2448e817df62d3422c /src/nvim/option.c | |
parent | 4292575dfc3ecd02874fc291769c8b496bf94abf (diff) | |
download | rneovim-5a564bf242828a04c8fe12c7e83154cb09acf4aa.tar.gz rneovim-5a564bf242828a04c8fe12c7e83154cb09acf4aa.tar.bz2 rneovim-5a564bf242828a04c8fe12c7e83154cb09acf4aa.zip |
refactor: cast to int earlier when using 'so' and 'siso' (#24756)
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r-- | src/nvim/option.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index bece6f3605..4ca52baa78 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -6117,20 +6117,20 @@ dict_T *get_winbuf_options(const int bufopt) /// Return the effective 'scrolloff' value for the current window, using the /// global value when appropriate. -linenr_T get_scrolloff_value(win_T *wp) +int get_scrolloff_value(win_T *wp) { // Disallow scrolloff in terminal-mode. #11915 if (State & MODE_TERMINAL) { return 0; } - return wp->w_p_so < 0 ? (linenr_T)p_so : (linenr_T)wp->w_p_so; + return (int)(wp->w_p_so < 0 ? p_so : wp->w_p_so); } /// Return the effective 'sidescrolloff' value for the current window, using the /// global value when appropriate. -long get_sidescrolloff_value(win_T *wp) +int get_sidescrolloff_value(win_T *wp) { - return wp->w_p_siso < 0 ? p_siso : wp->w_p_siso; + return (int)(wp->w_p_siso < 0 ? p_siso : wp->w_p_siso); } Dictionary get_vimoption(String name, int scope, buf_T *buf, win_T *win, Error *err) |