Skip to content

Conversation

janlazo
Copy link
Contributor

@janlazo janlazo commented Sep 30, 2025

Problem: Code for handling v: variables in generic eval file.
Solution: Move v: variables to evalvars.c. (Yegappan Lakshmanan,
closes vim/vim#4872)

vim/vim@e5cdf15

// eval.c

// TODO
// -bool is_compatht(const hashtab_T *ht)
//
// to eval/vars.c
// -void prepare_vimvar(int idx, typval_T *save_tv);
// -void restore_vimvar(int idx, typval_T *save_tv);
// -char_u *get_user_var_name(expand_T *xp, int idx);
// -typval_T *get_vim_var_tv(int idx);
// -dictitem_T *find_var_in_ht(hashtab_T *ht, int htname, char_u *varname, int no_autoload);
// eval/vars.c
// +  void evalvars_init(void);
// +  void evalvars_clear(void);

+void prepare_vimvar(int idx, typval_T *save_tv);
+void restore_vimvar(int idx, typval_T *save_tv);
+char_u *get_user_var_name(expand_T *xp, int idx);
+typval_T *get_vim_var_tv(int idx);
+dictitem_T *find_var_in_ht(hashtab_T *ht, int htname, char_u *varname, int no_autoload);

@janlazo janlazo force-pushed the vim-8.1.1939 branch 3 times, most recently from 8cadb11 to 1c1ee33 Compare October 2, 2025 03:24
@janlazo janlazo changed the title draft: vim-patch:partial:8.1.1939: code for handling v: variables in generic… draft: vim-patch:partial:8.1.1939: code for handling v: variables … Oct 2, 2025
@janlazo janlazo force-pushed the vim-8.1.1939 branch 3 times, most recently from a48c61d to bd82007 Compare October 3, 2025 23:56
@janlazo janlazo marked this pull request as ready for review October 3, 2025 23:56
@janlazo janlazo changed the title draft: vim-patch:partial:8.1.1939: code for handling v: variables … vim-patch:partial:8.1.1939: code for handling v: variables … Oct 3, 2025
@zeertzjq zeertzjq changed the title vim-patch:partial:8.1.1939: code for handling v: variables … vim-patch:partial:8.1.1939: code for handling v: variables in generic eval file Oct 4, 2025
… eval file

Problem:    Code for handling v: variables in generic eval file.
Solution:   Move v: variables to evalvars.c. (Yegappan Lakshmanan,
            closes vim/vim#4872)

vim/vim@e5cdf15

Remove direct reference to "vimvars" for following functions:
- assert_error()
- get_vim_var_nr()
- get_vim_var_list()
- get_vim_var_dict()
- get_vim_var_str()
- set_cmdarg()
- set_reg_var()
- set_vcount()
- set_vexception()
- set_vthrowpoint()
- set_vim_var_bool()
- set_vim_var_dict()
- set_vim_var_list()
- set_vim_var_nr()
- set_vim_var_special()
- set_vim_var_string()
- set_vim_var_type()

Reorder functions based on v8.2.4930 for
eval_one_expr_in_str() and eval_all_expr_in_str().

Co-authored-by: Bram Moolenaar <[email protected]>
@zeertzjq zeertzjq enabled auto-merge (squash) October 4, 2025 04:14
@zeertzjq zeertzjq merged commit 96e9041 into neovim:master Oct 4, 2025
35 checks passed
@janlazo janlazo deleted the vim-8.1.1939 branch October 4, 2025 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants