diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-11-29 20:39:38 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-11-29 20:39:38 +0000 |
commit | 651fca85c71a4c5807f8f828f9ded30fbd754325 (patch) | |
tree | 8e8524432d917e2657b7717aeb40823b21b1c38c | |
parent | 0c359af5c0fd106d3f57cc0bb7cef1c89b5e1e10 (diff) |
patch 8.2.3699: the +title feature adds a lot of #ifdef but little codev8.2.3699
Problem: The +title feature adds a lot of #ifdef but little code.
Solution: Graduate the +title feature.
-rw-r--r-- | runtime/doc/options.txt | 12 | ||||
-rw-r--r-- | runtime/doc/various.txt | 2 | ||||
-rw-r--r-- | src/alloc.c | 2 | ||||
-rw-r--r-- | src/arglist.c | 6 | ||||
-rw-r--r-- | src/autocmd.c | 2 | ||||
-rw-r--r-- | src/buffer.c | 8 | ||||
-rw-r--r-- | src/bufwrite.c | 2 | ||||
-rw-r--r-- | src/change.c | 4 | ||||
-rw-r--r-- | src/drawscreen.c | 7 | ||||
-rw-r--r-- | src/evalfunc.c | 8 | ||||
-rw-r--r-- | src/ex_cmds.c | 2 | ||||
-rw-r--r-- | src/ex_docmd.c | 10 | ||||
-rw-r--r-- | src/feature.h | 14 | ||||
-rw-r--r-- | src/globals.h | 15 | ||||
-rw-r--r-- | src/gui.c | 11 | ||||
-rw-r--r-- | src/gui_gtk_x11.c | 2 | ||||
-rw-r--r-- | src/if_xcmdsrv.c | 2 | ||||
-rw-r--r-- | src/locale.c | 2 | ||||
-rw-r--r-- | src/main.c | 4 | ||||
-rw-r--r-- | src/misc2.c | 2 | ||||
-rw-r--r-- | src/netbeans.c | 4 | ||||
-rw-r--r-- | src/option.c | 24 | ||||
-rw-r--r-- | src/option.h | 4 | ||||
-rw-r--r-- | src/optiondefs.h | 25 | ||||
-rw-r--r-- | src/optionstr.c | 14 | ||||
-rw-r--r-- | src/os_amiga.c | 6 | ||||
-rw-r--r-- | src/os_mswin.c | 30 | ||||
-rw-r--r-- | src/os_unix.c | 26 | ||||
-rw-r--r-- | src/os_win32.c | 28 | ||||
-rw-r--r-- | src/regexp.c | 3 | ||||
-rw-r--r-- | src/term.c | 8 | ||||
-rw-r--r-- | src/ui.c | 3 | ||||
-rw-r--r-- | src/version.c | 6 | ||||
-rw-r--r-- | src/window.c | 2 |
34 files changed, 56 insertions, 244 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index c7b280f684..6c589d1429 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -4190,8 +4190,6 @@ A jump table for the options with a short description can be found at |Q_op|. *'icon'* *'noicon'* 'icon' boolean (default off, on when title can be restored) global - {not available when compiled without the |+title| - feature} When on, the icon text of the window will be set to the value of 'iconstring' (if it is not empty), or to the name of the file currently being edited. Only the last part of the name is used. @@ -4208,8 +4206,6 @@ A jump table for the options with a short description can be found at |Q_op|. *'iconstring'* 'iconstring' string (default "") global - {not available when compiled without the |+title| - feature} When this option is not empty, it will be used for the icon text of the window. This happens only when the 'icon' option is on. Only works if the terminal supports setting window icon text @@ -8141,8 +8137,6 @@ A jump table for the options with a short description can be found at |Q_op|. *'title'* *'notitle'* 'title' boolean (default off, on when title can be restored) global - {not available when compiled without the |+title| - feature} When on, the title of the window will be set to the value of 'titlestring' (if it is not empty), or to: filename [+=-] (path) - VIM @@ -8176,8 +8170,6 @@ A jump table for the options with a short description can be found at |Q_op|. *'titlelen'* 'titlelen' number (default 85) global - {not available when compiled without the |+title| - feature} Gives the percentage of 'columns' to use for the length of the window title. When the title is longer, only the end of the path name is shown. A '<' character before the path name is used to indicate this. @@ -8191,8 +8183,6 @@ A jump table for the options with a short description can be found at |Q_op|. *'titleold'* 'titleold' string (default "Thanks for flying Vim") global - {only available when compiled with the |+title| - feature} This option will be used for the window title when exiting Vim if the original title cannot be restored. Only happens if 'title' is on or 'titlestring' is not empty. @@ -8201,8 +8191,6 @@ A jump table for the options with a short description can be found at |Q_op|. *'titlestring'* 'titlestring' string (default "") global - {not available when compiled without the |+title| - feature} When this option is not empty, it will be used for the title of the window. This happens only when the 'title' option is on. Only works if the terminal supports setting window titles (currently diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index e9c6b7b55e..290eb4f1cf 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -471,7 +471,7 @@ N *+textobjects* |text-objects| selection N *+textprop* |text-properties| *+tgetent* non-Unix only: able to use external termcap N *+timers* the |timer_start()| function -N *+title* Setting the window 'title' and 'icon' +N *+title* Setting the window 'title' and 'icon'; Always enabled N *+toolbar* |gui-toolbar| T *+user_commands* User-defined commands. |user-commands| Always enabled since 8.1.1210. diff --git a/src/alloc.c b/src/alloc.c index d0901f473b..42caa41801 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -421,9 +421,7 @@ free_all_mem(void) # endif } -# ifdef FEAT_TITLE free_titles(); -# endif # if defined(FEAT_SEARCHPATH) free_findfile(); # endif diff --git a/src/arglist.c b/src/arglist.c index 244dd06782..24b0a870e2 100644 --- a/src/arglist.c +++ b/src/arglist.c @@ -770,9 +770,7 @@ ex_argedit(exarg_T *eap) if (do_arglist(eap->arg, AL_ADD, i, TRUE) == FAIL) return; -#ifdef FEAT_TITLE maketitle(); -#endif if (curwin->w_arg_idx == 0 && (curbuf->b_ml.ml_flags & ML_EMPTY) @@ -792,9 +790,7 @@ ex_argadd(exarg_T *eap) do_arglist(eap->arg, AL_ADD, eap->addr_count > 0 ? (int)eap->line2 : curwin->w_arg_idx + 1, FALSE); -#ifdef FEAT_TITLE maketitle(); -#endif } /* @@ -853,9 +849,7 @@ ex_argdelete(exarg_T *eap) } else do_arglist(eap->arg, AL_DEL, 0, FALSE); -#ifdef FEAT_TITLE maketitle(); -#endif } /* diff --git a/src/autocmd.c b/src/autocmd.c index ac21196b9a..5ec911ab74 100644 --- a/src/autocmd.c +++ b/src/autocmd.c @@ -2253,10 +2253,8 @@ apply_autocmds_group( || event == EVENT_VIMLEAVE || event == EVENT_VIMLEAVEPRE)) { -#ifdef FEAT_TITLE if (curbuf->b_changed != save_changed) need_maketitle = TRUE; -#endif curbuf->b_changed = save_changed; } diff --git a/src/buffer.c b/src/buffer.c index e2732de7a8..20a0d66606 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -44,9 +44,7 @@ static int buf_same_ino(buf_T *buf, stat_T *stp); #else static int otherfile_buf(buf_T *buf, char_u *ffname); #endif -#ifdef FEAT_TITLE static int value_changed(char_u *str, char_u **last); -#endif static int append_arg_number(win_T *wp, char_u *buf, int buflen, int add_file); static void free_buffer(buf_T *); static void free_buffer_stuff(buf_T *buf, int free_options); @@ -1856,9 +1854,7 @@ enter_buffer(buf_T *buf) buflist_getfpos(); check_arg_idx(curwin); // check for valid arg_idx -#ifdef FEAT_TITLE maketitle(); -#endif // when autocmds didn't change it if (curwin->w_topline == 1 && !curwin->w_topline_was_set) scroll_cursor_halfway(FALSE); // redisplay at correct position @@ -3461,9 +3457,7 @@ buf_name_changed(buf_T *buf) if (curwin->w_buffer == buf) check_arg_idx(curwin); // check file name for arg list -#ifdef FEAT_TITLE maketitle(); // set window title -#endif status_redraw_all(); // status lines need to be redrawn fmarks_check_names(buf); // check named file marks ml_timestamp(buf); // reset timestamp @@ -3780,7 +3774,6 @@ col_print( vim_snprintf((char *)buf, buflen, "%d-%d", col, vcol); } -#if defined(FEAT_TITLE) || defined(PROTO) static char_u *lasttitle = NULL; static char_u *lasticon = NULL; @@ -4045,7 +4038,6 @@ free_titles(void) } # endif -#endif // FEAT_TITLE #if defined(FEAT_STL_OPT) || defined(FEAT_GUI_TABLINE) || defined(PROTO) diff --git a/src/bufwrite.c b/src/bufwrite.c index 0313e0ce37..76c36e18e9 100644 --- a/src/bufwrite.c +++ b/src/bufwrite.c @@ -1630,9 +1630,7 @@ buf_write( if (forceit && overwriting && vim_strchr(p_cpo, CPO_KEEPRO) == NULL) { buf->b_p_ro = FALSE; -#ifdef FEAT_TITLE need_maketitle = TRUE; // set window title later -#endif status_redraw_all(); // redraw status lines later } diff --git a/src/change.c b/src/change.c index e171956207..308cc18120 100644 --- a/src/change.c +++ b/src/change.c @@ -146,9 +146,7 @@ changed_internal(void) ml_setflags(curbuf); check_status(curbuf); redraw_tabline = TRUE; -#ifdef FEAT_TITLE need_maketitle = TRUE; // set window title later -#endif } #ifdef FEAT_EVAL @@ -892,9 +890,7 @@ unchanged(buf_T *buf, int ff, int always_inc_changedtick) save_file_ff(buf); check_status(buf); redraw_tabline = TRUE; -#ifdef FEAT_TITLE need_maketitle = TRUE; // set window title later -#endif ++CHANGEDTICK(buf); } else if (always_inc_changedtick) diff --git a/src/drawscreen.c b/src/drawscreen.c index 52f6273451..f56ef91f29 100644 --- a/src/drawscreen.c +++ b/src/drawscreen.c @@ -610,15 +610,14 @@ showruler(int always) win_redr_ruler(curwin, always, FALSE); #endif -#ifdef FEAT_TITLE if (need_maketitle -# ifdef FEAT_STL_OPT +#ifdef FEAT_STL_OPT || (p_icon && (stl_syntax & STL_IN_ICON)) || (p_title && (stl_syntax & STL_IN_TITLE)) -# endif +#endif ) maketitle(); -#endif + // Redraw the tab pages line if needed. if (redraw_tabline) draw_tabline(); diff --git a/src/evalfunc.c b/src/evalfunc.c index ad9691efd0..e04052b8ac 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -5787,13 +5787,7 @@ f_has(typval_T *argvars, typval_T *rettv) 0 #endif }, - {"title", -#ifdef FEAT_TITLE - 1 -#else - 0 -#endif - }, + {"title", 1}, {"toolbar", #ifdef FEAT_TOOLBAR 1 diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 079dcf10e9..10c8e617c9 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -3082,9 +3082,7 @@ do_ecmd( // Even when cursor didn't move we need to recompute topline. changed_line_abv_curs(); -#ifdef FEAT_TITLE maketitle(); -#endif #if defined(FEAT_PROP_POPUP) && defined(FEAT_QUICKFIX) if (WIN_IS_POPUP(curwin) && curwin->w_p_pvw && retval != FAIL) popup_set_title(curwin); diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 523d8af30e..d4863115d8 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -6205,14 +6205,10 @@ ex_stop(exarg_T *eap) out_flush(); stoptermcap(); out_flush(); // needed for SUN to restore xterm buffer -#ifdef FEAT_TITLE mch_restore_title(SAVE_RESTORE_BOTH); // restore window titles -#endif ui_suspend(); // call machine specific function -#ifdef FEAT_TITLE maketitle(); resettitle(); // force updating the title -#endif starttermcap(); scroll_start(); // scroll screen before redrawing redraw_later_clear(); @@ -7047,14 +7043,10 @@ do_exedit( { if (eap->do_ecmd_cmd != NULL) do_cmd_argument(eap->do_ecmd_cmd); -#ifdef FEAT_TITLE n = curwin->w_arg_idx_invalid; -#endif check_arg_idx(curwin); -#ifdef FEAT_TITLE if (n != curwin->w_arg_idx_invalid) maketitle(); -#endif } /* @@ -8178,10 +8170,8 @@ ex_redraw(exarg_T *eap) validate_cursor(); update_topline(); update_screen(eap->forceit ? CLEAR : VIsual_active ? INVERTED : 0); -#ifdef FEAT_TITLE if (need_maketitle) maketitle(); -#endif #if defined(MSWIN) && (!defined(FEAT_GUI_MSWIN) || defined(VIMDLL)) # ifdef VIMDLL if (!gui.in_use) diff --git a/src/feature.h b/src/feature.h index 2ae739aa82..36761ca499 100644 --- a/src/feature.h +++ b/src/feature.h @@ -109,6 +109,7 @@ * +insert_expand CTRL-N/CTRL-P/CTRL-X in insert mode. * +modify_fname modifiers for file name. E.g., "%:p:h". * +comments 'comments' option. + * +title 'title' and 'icon' options * * Obsolete: * +tag_old_static Old style static tags: "file:tag file ..". @@ -360,17 +361,9 @@ #endif /* - * +title 'title' and 'icon' options * +statusline 'statusline', 'rulerformat' and special format of * 'titlestring' and 'iconstring' options. - * +byte_offset '%o' in 'statusline' and builtin functions line2byte() - * and byte2line(). - * Note: Required for Macintosh. */ -#if defined(FEAT_NORMAL) -# define FEAT_TITLE -#endif - #ifdef FEAT_NORMAL # define FEAT_STL_OPT # ifndef FEAT_CMDL_INFO @@ -378,6 +371,11 @@ # endif #endif +/* + * +byte_offset '%o' in 'statusline' and builtin functions line2byte() + * and byte2line(). + * Note: Required for Macintosh. + */ #ifdef FEAT_NORMAL # define FEAT_BYTEOFF #endif diff --git a/src/globals.h b/src/globals.h index 8f4f5a575c..f90dea20b8 100644 --- a/src/globals.h +++ b/src/globals.h @@ -252,9 +252,7 @@ EXTERN int no_wait_return INIT(= 0); // don't wait for return for now EXTERN int need_wait_return INIT(= 0); // need to wait for return later EXTERN int did_wait_return INIT(= FALSE); // wait_return() was used and // nothing written since then -#ifdef FEAT_TITLE EXTERN int need_maketitle INIT(= TRUE); // call maketitle() soon -#endif EXTERN int quit_more INIT(= FALSE); // 'q' hit at "--more--" msg #if defined(UNIX) || defined(VMS) || defined(MACOS_X) @@ -1037,17 +1035,26 @@ EXTERN vimconv_T output_conv; // type of output conversion */ // length of char in bytes, including following composing chars EXTERN int (*mb_ptr2len)(char_u *p) INIT(= latin_ptr2len); + // idem, with limit on string length EXTERN int (*mb_ptr2len_len)(char_u *p, int size) INIT(= latin_ptr2len_len); + // byte length of char EXTERN int (*mb_char2len)(int c) INIT(= latin_char2len); -// convert char to bytes, return the length + +// Convert char "c" to bytes in "buf", return the length. "buf" must have room +// for at least 6 bytes. EXTERN int (*mb_char2bytes)(int c, char_u *buf) INIT(= latin_char2bytes); + EXTERN int (*mb_ptr2cells)(char_u *p) INIT(= latin_ptr2cells); EXTERN int (*mb_ptr2cells_len)(char_u *p, int size) INIT(= latin_ptr2cells_len); EXTERN int (*mb_char2cells)(int c) INIT(= latin_char2cells); EXTERN int (*mb_off2cells)(unsigned off, unsigned max_off) INIT(= latin_off2cells); EXTERN int (*mb_ptr2char)(char_u *p) INIT(= latin_ptr2char); + +// Byte offset from "p" to the start of a character, including any composing +// characters. "base" must be the start of the string, which must be NUL +// terminated. EXTERN int (*mb_head_off)(char_u *base, char_u *p) INIT(= latin_head_off); # if defined(USE_ICONV) && defined(DYNAMIC_ICONV) @@ -1402,7 +1409,7 @@ EXTERN struct subs_expr_S *substitute_instr INIT(= NULL); // table to store parsed 'wildmode' EXTERN char_u wim_flags[4]; -#if defined(FEAT_TITLE) && defined(FEAT_STL_OPT) +#if defined(FEAT_STL_OPT) // whether titlestring and iconstring contains statusline syntax # define STL_IN_ICON 1 # define STL_IN_TITLE 2 @@ -138,7 +138,7 @@ gui_start(char_u *arg UNUSED) // Back to old term settings // // FIXME: If we got here because a child process failed and flagged to - // the parent to resume, and X11 is enabled with FEAT_TITLE, this will + // the parent to resume, and X11 is enabled, this will // hit an X11 I/O error and do a longjmp(), leaving recursive // permanently set to 1. This is probably not as big a problem as it // sounds, because gui_mch_init() in both gui_x11.c and gui_gtk_x11.c @@ -146,9 +146,7 @@ gui_start(char_u *arg UNUSED) // actually hit this case. termcapinit(old_term); settmode(TMODE_RAW); // restart RAW mode -#ifdef FEAT_TITLE set_title_defaults(); // set 'title' and 'icon' again -#endif #if defined(GUI_MAY_SPAWN) && defined(EXPERIMENTAL_GUI_CMD) if (msg) emsg(msg); @@ -741,10 +739,9 @@ gui_init(void) */ if (gui_mch_open() != FAIL) { -#ifdef FEAT_TITLE maketitle(); resettitle(); -#endif + init_gui_options(); #ifdef FEAT_ARABIC // Our GUI can't do bidi. @@ -4413,10 +4410,8 @@ gui_update_scrollbars( } } -#ifdef FEAT_TITLE // update the title, it may show the scroll position maketitle(); -#endif prev_curwin = curwin; --hold_gui_events; @@ -5558,9 +5553,7 @@ drop_callback(void *cookie) # ifdef FEAT_MENU gui_update_menus(0); # endif -#ifdef FEAT_TITLE maketitle(); -#endif setcursor(); out_flush_cursor(FALSE, FALSE); } diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c index 6381a95f6a..2d313f7772 100644 --- a/src/gui_gtk_x11.c +++ b/src/gui_gtk_x11.c @@ -4540,7 +4540,6 @@ gui_mch_set_shellsize(int width, int height, gui_mch_update(); } -#if defined(FEAT_TITLE) || defined(PROTO) void gui_mch_settitle(char_u *title, char_u *icon UNUSED) { @@ -4552,7 +4551,6 @@ gui_mch_settitle(char_u *title, char_u *icon UNUSED) if (output_conv.vc_type != CONV_NONE) vim_free(title); } -#endif // FEAT_TITLE #if defined(FEAT_MENU) || defined(PROTO) void diff --git a/src/if_xcmdsrv.c b/src/if_xcmdsrv.c index 73f2c9e1a9..901afc4677 100644 --- a/src/if_xcmdsrv.c +++ b/src/if_xcmdsrv.c @@ -314,9 +314,7 @@ DoRegisterName(Display *dpy, char_u *name) set_vim_var_string(VV_SEND_SERVER, name, -1); #endif serverName = vim_strsave(name); -#ifdef FEAT_TITLE need_maketitle = TRUE; -#endif return 0; } return -2; diff --git a/src/locale.c b/src/locale.c index 7fad9d9fe5..54f416161d 100644 --- a/src/locale.c +++ b/src/locale.c @@ -390,9 +390,7 @@ ex_language(exarg_T *eap) // Set v:lang, v:lc_time, v:collate and v:ctype to the final result. set_lang_var(); # endif -# ifdef FEAT_TITLE maketitle(); -# endif } } } diff --git a/src/main.c b/src/main.c index 50047d5554..268209e8da 100644 --- a/src/main.c +++ b/src/main.c @@ -668,7 +668,7 @@ vim_main2(void) scroll_region_reset(); // In case Rows changed scroll_start(); // may scroll the screen to the right position -#if defined(FEAT_TITLE) && (defined(UNIX) || defined(VMS) || defined(MACOS_X)) +#if defined(UNIX) || defined(VMS) || defined(MACOS_X) term_push_title(SAVE_RESTORE_BOTH); #endif @@ -1395,10 +1395,8 @@ main_loop( else if (redraw_cmdline || clear_cmdline) showmode(); redraw_statuslines(); -#ifdef FEAT_TITLE if (need_maketitle) maketitle(); -#endif #ifdef FEAT_VIMINFO curbuf->b_last_used = vim_time(); #endif diff --git a/src/misc2.c b/src/misc2.c index 8e01434eae..9407087494 100644 --- a/src/misc2.c +++ b/src/misc2.c @@ -1735,9 +1735,7 @@ set_fileformat( // This may cause the buffer to become (un)modified. check_status(curbuf); redraw_tabline = TRUE; -#ifdef FEAT_TITLE need_maketitle = TRUE; // set window title later -#endif } /* diff --git a/src/netbeans.c b/src/netbeans.c index 003cc531d1..00be244fbf 100644 --- a/src/netbeans.c +++ b/src/netbeans.c @@ -1669,9 +1669,7 @@ nb_do_cmd( buf->bufp = curbuf; buf->initDone = TRUE; do_update = 1; -#if defined(FEAT_TITLE) maketitle(); -#endif #if defined(FEAT_MENU) && defined(FEAT_GUI) if (gui.in_use) gui_update_menus(0); @@ -1748,9 +1746,7 @@ nb_do_cmd( { check_status(buf->bufp); redraw_tabline = TRUE; -#ifdef FEAT_TITLE maketitle(); -#endif update_screen(0); } // ===================================================================== diff --git a/src/option.c b/src/option.c index 4422634e2a..fd1910c6d7 100644 --- a/src/option.c +++ b/src/option.c @@ -1102,9 +1102,7 @@ set_init_3(void) set_fileformat(default_fileformat(), OPT_LOCAL); } -#ifdef FEAT_TITLE set_title_defaults(); -#endif } #if defined(FEAT_MULTI_LANG) || defined(PROTO) @@ -1148,7 +1146,6 @@ set_helplang_default(char_u *lang) } #endif -#ifdef FEAT_TITLE /* * 'title' and 'icon' only default to true if they have not been set or reset * in .vimrc and we can read the old value. @@ -1192,7 +1189,6 @@ set_title_defaults(void) p_icon = val; } } -#endif void ex_set(exarg_T *eap) @@ -2272,7 +2268,6 @@ string_to_key(char_u *arg, int multi_byte) return *arg; } -#ifdef FEAT_TITLE /* * When changing 'title', 'titlestring', 'icon' or 'iconstring', call * maketitle() to create and display it. @@ -2289,7 +2284,6 @@ did_set_title(void) ) maketitle(); } -#endif /* * set_options_bin - called when 'bin' changes value. @@ -2558,7 +2552,6 @@ insecure_flag(int opt_idx, int opt_flags) } #endif -#if defined(FEAT_TITLE) || defined(PROTO) /* * Redraw the window title and/or tab page text later. */ @@ -2567,7 +2560,6 @@ void redraw_titles(void) need_maketitle = TRUE; redraw_tabline = TRUE; } -#endif /* * Return TRUE if "val" is a valid name: only consists of alphanumeric ASCII @@ -2809,9 +2801,7 @@ set_bool_option( if (curbuf->b_p_ro) curbuf->b_did_warn = FALSE; -#ifdef FEAT_TITLE redraw_titles(); -#endif } #ifdef FEAT_GUI @@ -2834,11 +2824,8 @@ set_bool_option( return N_("E946: Cannot make a terminal with running job modifiable"); } # endif -# ifdef FEAT_TITLE redraw_titles(); -# endif } -#ifdef FEAT_TITLE // when 'endofline' is changed, redraw the window title else if ((int *)varp == &curbuf->b_p_eol) { @@ -2854,15 +2841,12 @@ set_bool_option( { redraw_titles(); } -#endif // when 'bin' is set also set some other options else if ((int *)varp == &curbuf->b_p_bin) { set_options_bin(old_value, curbuf->b_p_bin, opt_flags); -#ifdef FEAT_TITLE redraw_titles(); -#endif } // when 'buflisted' changes, trigger autocommands @@ -2996,21 +2980,17 @@ set_bool_option( } #endif -#ifdef FEAT_TITLE // when 'title' changed, may need to change the title; same for 'icon' else if ((int *)varp == &p_title || (int *)varp == &p_icon) { did_set_title(); } -#endif else if ((int *)varp == &curbuf->b_changed) { if (!value) save_file_ff(curbuf); // Buffer is unchanged -#ifdef FEAT_TITLE redraw_titles(); -#endif modified_was_set = value; } @@ -3566,7 +3546,6 @@ set_num_option( p_imsearch = curbuf->b_p_imsearch; } -#ifdef FEAT_TITLE // if 'titlelen' has changed, redraw the title else if (pp == &p_titlelen) { @@ -3578,7 +3557,6 @@ set_num_option( if (starting != NO_SCREEN && old_value != p_titlelen) need_maketitle = TRUE; } -#endif // if p_ch changed value, change the command line height else if (pp == &p_ch) @@ -4971,9 +4949,7 @@ clear_termoptions(void) * screen will be cleared later, so this is OK. */ mch_setmouse(FALSE); // switch mouse off -#ifdef FEAT_TITLE mch_restore_title(SAVE_RESTORE_BOTH); // restore window titles -#endif #if defined(FEAT_XCLIPBOARD) && defined(FEAT_GUI) // When starting the GUI close the display opened for the clipboard. // After restoring the title, because that will need the display. diff --git a/src/option.h b/src/option.h index 21ee569b1f..080d90d5c0 100644 --- a/src/option.h +++ b/src/option.h @@ -657,10 +657,8 @@ EXTERN int p_hkmapp; // 'hkmapp' EXTERN int p_arshape; // 'arabicshape' # endif #endif -#ifdef FEAT_TITLE EXTERN int p_icon; // 'icon' EXTERN char_u *p_iconstring; // 'iconstring' -#endif EXTERN int p_ic; // 'ignorecase' #if defined(FEAT_XIM) && defined(FEAT_GUI_GTK) EXTERN char_u *p_imak; // 'imactivatekey' @@ -986,12 +984,10 @@ EXTERN long p_tw; // 'textwidth' EXTERN int p_to; // 'tildeop' EXTERN int p_timeout; // 'timeout' EXTERN long p_tm; // 'timeoutlen' -#ifdef FEAT_TITLE EXTERN int p_title; // 'title' EXTERN long p_titlelen; // 'titlelen' EXTERN char_u *p_titleold; // 'titleold' EXTERN char_u *p_titlestring; // 'titlestring' -#endif EXTERN char_u *p_tsr; // 'thesaurus' EXTERN int p_ttimeout; // 'ttimeout' EXTERN long p_ttm; // 'ttimeoutlen' diff --git a/src/optiondefs.h b/src/optiondefs.h index d46cfadc00..5a9a674537 100644 --- a/src/optiondefs.h +++ b/src/optiondefs.h @@ -1313,18 +1313,10 @@ static struct vimoption options[] = (char_u *)&p_hls, PV_NONE, {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"icon", NULL, P_BOOL|P_VI_DEF, -#ifdef FEAT_TITLE (char_u *)&p_icon, PV_NONE, -#else - (char_u *)NULL, PV_NONE, -#endif {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"iconstring", NULL, P_STRING|P_VI_DEF|P_MLE, -#ifdef FEAT_TITLE (char_u *)&p_iconstring, PV_NONE, -#else - (char_u *)NULL, PV_NONE, -#endif {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"ignorecase", "ic", P_BOOL|P_VI_DEF, (char_u *)&p_ic, PV_NONE, @@ -2651,35 +2643,18 @@ static struct vimoption options[] = (char_u *)&p_tm, PV_NONE, {(char_u *)1000L, (char_u *)0L} SCTX_INIT}, {"title", NULL, P_BOOL|P_VI_DEF, -#ifdef FEAT_TITLE (char_u *)&p_title, PV_NONE, -#else - (char_u *)NULL, PV_NONE, -#endif {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"titlelen", NULL, P_NUM|P_VI_DEF, -#ifdef FEAT_TITLE (char_u *)&p_titlelen, PV_NONE, -#else - (char_u *)NULL, PV_NONE, -#endif {(char_u *)85L, (char_u *)0L} SCTX_INIT}, {"titleold", NULL, P_STRING|P_VI_DEF|P_GETTEXT|P_SECURE|P_NO_MKRC, -#ifdef FEAT_TITLE (char_u *)&p_titleold, PV_NONE, {(char_u *)N_("Thanks for flying Vim"), (char_u *)0L} -#else - (char_u *)NULL, PV_NONE, - {(char_u *)0L, (char_u *)0L} -#endif SCTX_INIT}, {"titlestring", NULL, P_STRING|P_VI_DEF|P_MLE, -#ifdef FEAT_TITLE (char_u *)&p_titlestring, PV_NONE, -#else - (char_u *)NULL, PV_NONE, -#endif {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"toolbar", "tb", P_STRING|P_ONECOMMA|P_VI_DEF|P_NODUP, #if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_MSWIN) diff --git a/src/optionstr.c b/src/optionstr.c index 8948830c80..1b0d8a1675 100644 --- a/src/optionstr.c +++ b/ |