comparison src/vim.h @ 31996:ca6bc7c04163 v9.0.1330

patch 9.0.1330: handling new value of an option has a long "else if" chain Commit: https://github.com/vim/vim/commit/af93691b53f38784efce0b93fe7644c44a7e382e Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Mon Feb 20 12:16:39 2023 +0000 patch 9.0.1330: handling new value of an option has a long "else if" chain Problem: Handling new value of an option has a long "else if" chain. Solution: Use a function pointer. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/12015)
author Bram Moolenaar <Bram@vim.org>
date Mon, 20 Feb 2023 13:30:05 +0100
parents 16025ef158bf
children 4545f58c8490
comparison
equal deleted inserted replaced
31995:95971aa5e525 31996:ca6bc7c04163
2282 FCERR_DELETED, // function was deleted 2282 FCERR_DELETED, // function was deleted
2283 FCERR_NOTMETHOD, // function cannot be used as a method 2283 FCERR_NOTMETHOD, // function cannot be used as a method
2284 FCERR_FAILED, // error while executing the function 2284 FCERR_FAILED, // error while executing the function
2285 } funcerror_T; 2285 } funcerror_T;
2286 2286
2287 /*
2288 * Type for the callback function that is invoked after an option value is
2289 * changed to validate and apply the new value.
2290 */
2291 typedef char *(*opt_did_set_cb_T)(optset_T *args);
2292
2287 // Flags for assignment functions. 2293 // Flags for assignment functions.
2288 #define ASSIGN_VAR 0 // ":var" (nothing special) 2294 #define ASSIGN_VAR 0 // ":var" (nothing special)
2289 #define ASSIGN_FINAL 0x01 // ":final" 2295 #define ASSIGN_FINAL 0x01 // ":final"
2290 #define ASSIGN_CONST 0x02 // ":const" 2296 #define ASSIGN_CONST 0x02 // ":const"
2291 #define ASSIGN_NO_DECL 0x04 // "name = expr" without ":let"/":const"/":final" 2297 #define ASSIGN_NO_DECL 0x04 // "name = expr" without ":let"/":const"/":final"