view src/proto/optionstr.pro @ 34379:37b4c89ba420 v9.1.0116

patch 9.1.0116: win_split_ins may not check available room Commit: https://github.com/vim/vim/commit/0fd44a5ad81ade342cb54d8984965bdedd2272c8 Author: Sean Dewar <6256228+seandewar@users.noreply.github.com> Date: Tue Feb 20 20:28:15 2024 +0100 patch 9.1.0116: win_split_ins may not check available room Problem: win_split_ins has no check for E36 when moving an existing window Solution: check for room and fix the issues in f_win_splitmove() (Sean Dewar) win_split_ins has no check for E36 when moving an existing window, allowing for layouts with many overlapping zero-sized windows to be created (which may also cause drawing issues with tablines and such). f_win_splitmove also has some bugs. So check for room and fix the issues in f_win_splitmove. Handle failure in the two relevant win_split_ins callers by restoring the original layout, and factor the common logic into win_splitmove. Don't check for room when opening an autocommand window, as it's a temporary window that's rarely interacted with or drawn anyhow, and is rather important for some autocommands. Issues fixed in f_win_splitmove: - Error if splitting is disallowed. - Fix heap-use-after-frees if autocommands fired from switching to "targetwin" close "wp" or "oldwin". - Fix splitting the wrong window if autocommands fired from switching to "targetwin" switch to a different window. - Ensure -1 is returned for all errors. Also handle allocation failure a bit earlier in make_snapshot (callers, except win_splitmove, don't really care if a snapshot can't be made, so just ignore the return value). Note: Test_smoothscroll_in_zero_width_window failed after these changes with E36, as it was using the previous behaviour to create a zero-width window. I've fixed the test such that it fails with UBSAN as expected when v9.0.1367 is reverted (and simplified it too). related: #14042 Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Tue, 20 Feb 2024 22:30:04 +0100
parents a7354a835a78
children 22f63041670a
line wrap: on
line source

/* optionstr.c */
void didset_string_options(void);
void trigger_optionset_string(int opt_idx, int opt_flags, char_u *oldval, char_u *oldval_l, char_u *oldval_g, char_u *newval);
void check_buf_options(buf_T *buf);
void free_string_option(char_u *p);
void clear_string_option(char_u **pp);
void check_string_option(char_u **pp);
void set_string_option_direct(char_u *name, int opt_idx, char_u *val, int opt_flags, int set_sid);
void set_string_option_direct_in_win(win_T *wp, char_u *name, int opt_idx, char_u *val, int opt_flags, int set_sid);
void set_string_option_direct_in_buf(buf_T *buf, char_u *name, int opt_idx, char_u *val, int opt_flags, int set_sid);
char *set_string_option(int opt_idx, char_u *value, int opt_flags, char *errbuf, size_t errbuflen);
char *did_set_ambiwidth(optset_T *args);
int expand_set_ambiwidth(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_background(optset_T *args);
int expand_set_background(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_backspace(optset_T *args);
int expand_set_backspace(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_backupcopy(optset_T *args);
int expand_set_backupcopy(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_backupext_or_patchmode(optset_T *args);
char *did_set_belloff(optset_T *args);
int expand_set_belloff(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_breakat(optset_T *args);
char *did_set_breakindentopt(optset_T *args);
int expand_set_breakindentopt(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_browsedir(optset_T *args);
int expand_set_browsedir(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_bufhidden(optset_T *args);
int expand_set_bufhidden(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_buftype(optset_T *args);
int expand_set_buftype(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_casemap(optset_T *args);
int expand_set_casemap(optexpand_T *args, int *numMatches, char_u ***matches);
int expand_set_clipboard(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_chars_option(optset_T *args);
int expand_set_chars_option(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_cinoptions(optset_T *args);
char *did_set_colorcolumn(optset_T *args);
char *did_set_comments(optset_T *args);
char *did_set_commentstring(optset_T *args);
char *did_set_complete(optset_T *args);
int expand_set_complete(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_completeopt(optset_T *args);
int expand_set_completeopt(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_completepopup(optset_T *args);
char *did_set_completeslash(optset_T *args);
int expand_set_completeslash(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_concealcursor(optset_T *args);
int expand_set_concealcursor(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_cpoptions(optset_T *args);
int expand_set_cpoptions(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_cryptkey(optset_T *args);
char *did_set_cryptmethod(optset_T *args);
int expand_set_cryptmethod(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_cscopequickfix(optset_T *args);
char *did_set_cursorlineopt(optset_T *args);
int expand_set_cursorlineopt(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_debug(optset_T *args);
int expand_set_debug(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_diffopt(optset_T *args);
int expand_set_diffopt(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_display(optset_T *args);
int expand_set_display(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_eadirection(optset_T *args);
int expand_set_eadirection(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_encoding(optset_T *args);
int expand_set_encoding(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_eventignore(optset_T *args);
int expand_set_eventignore(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_fileformat(optset_T *args);
int expand_set_fileformat(optexpand_T *args, int *numMatches, char_u ***matches);
char_u *get_fileformat_name(expand_T *xp, int idx);
char *did_set_fileformats(optset_T *args);
char *did_set_filetype_or_syntax(optset_T *args);
char *did_set_foldclose(optset_T *args);
int expand_set_foldclose(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_foldexpr(optset_T *args);
char *did_set_foldignore(optset_T *args);
char *did_set_foldmarker(optset_T *args);
char *did_set_foldmethod(optset_T *args);
int expand_set_foldmethod(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_foldopen(optset_T *args);
int expand_set_foldopen(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_formatoptions(optset_T *args);
int expand_set_formatoptions(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_guicursor(optset_T *args);
char *did_set_guifont(optset_T *args);
int expand_set_guifont(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_guifontset(optset_T *args);
char *did_set_guifontwide(optset_T *args);
char *did_set_guiligatures(optset_T *args);
char *did_set_guioptions(optset_T *args);
int expand_set_guioptions(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_guitablabel(optset_T *args);
char *did_set_helpfile(optset_T *args);
char *did_set_helplang(optset_T *args);
char *did_set_highlight(optset_T *args);
int expand_set_highlight(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_iconstring(optset_T *args);
char *did_set_imactivatekey(optset_T *args);
char *did_set_isopt(optset_T *args);
char *did_set_jumpoptions(optset_T *args);
int expand_set_jumpoptions(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_keymap(optset_T *args);
char *did_set_keymodel(optset_T *args);
int expand_set_keymodel(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_keyprotocol(optset_T *args);
int expand_set_keyprotocol(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_lispoptions(optset_T *args);
int expand_set_lispoptions(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_matchpairs(optset_T *args);
char *did_set_mkspellmem(optset_T *args);
char *did_set_mouse(optset_T *args);
int expand_set_mouse(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_mousemodel(optset_T *args);
int expand_set_mousemodel(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_mouseshape(optset_T *args);
char *did_set_nrformats(optset_T *args);
int expand_set_nrformats(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_optexpr(optset_T *args);
char *did_set_pastetoggle(optset_T *args);
char *did_set_previewpopup(optset_T *args);
int expand_set_popupoption(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_printencoding(optset_T *args);
int expand_set_printoptions(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_renderoptions(optset_T *args);
char *did_set_rightleftcmd(optset_T *args);
int expand_set_rightleftcmd(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_rulerformat(optset_T *args);
char *did_set_scrollopt(optset_T *args);
int expand_set_scrollopt(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_selection(optset_T *args);
int expand_set_selection(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_selectmode(optset_T *args);
int expand_set_selectmode(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_sessionoptions(optset_T *args);
int expand_set_sessionoptions(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_shortmess(optset_T *args);
int expand_set_shortmess(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_showbreak(optset_T *args);
char *did_set_showcmdloc(optset_T *args);
int expand_set_showcmdloc(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_signcolumn(optset_T *args);
int expand_set_signcolumn(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_spellcapcheck(optset_T *args);
char *did_set_spellfile(optset_T *args);
char *did_set_spelllang(optset_T *args);
char *did_set_spelloptions(optset_T *args);
int expand_set_spelloptions(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_spellsuggest(optset_T *args);
int expand_set_spellsuggest(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_splitkeep(optset_T *args);
int expand_set_splitkeep(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_statusline(optset_T *args);
char *did_set_swapsync(optset_T *args);
int expand_set_swapsync(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_switchbuf(optset_T *args);
int expand_set_switchbuf(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_tabline(optset_T *args);
char *did_set_tagcase(optset_T *args);
int expand_set_tagcase(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_term(optset_T *args);
char *did_set_term_option(optset_T *args);
char *did_set_termwinkey(optset_T *args);
char *did_set_termwinsize(optset_T *args);
char *did_set_termwintype(optset_T *args);
int expand_set_termwintype(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_titlestring(optset_T *args);
char *did_set_toolbar(optset_T *args);
int expand_set_toolbar(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_toolbariconsize(optset_T *args);
int expand_set_toolbariconsize(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_ttymouse(optset_T *args);
int expand_set_ttymouse(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_varsofttabstop(optset_T *args);
char *did_set_vartabstop(optset_T *args);
char *did_set_verbosefile(optset_T *args);
char *did_set_viewoptions(optset_T *args);
char *did_set_viminfo(optset_T *args);
char *did_set_virtualedit(optset_T *args);
int expand_set_virtualedit(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_whichwrap(optset_T *args);
int expand_set_whichwrap(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_wildmode(optset_T *args);
int expand_set_wildmode(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_wildoptions(optset_T *args);
int expand_set_wildoptions(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_winaltkeys(optset_T *args);
int expand_set_winaltkeys(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_wincolor(optset_T *args);
int expand_set_wincolor(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_string_option(int opt_idx, char_u **varp, char_u *oldval, char_u *value, char *errbuf, size_t errbuflen, int opt_flags, set_op_T op, int *value_checked);
int check_ff_value(char_u *p);
void save_clear_shm_value(void);
void restore_shm_value(void);
/* vim: set ft=c : */