Problem: Depending on the configuration some functions are unused.
Solution: Add more #ifdefs, remove unused functions. (Dominique Pelle,
closes #3822)
return buf != NULL && buf->b_p_bt[0] == NUL;
}
+#if defined(FEAT_QUICKFIX) || defined(PROTO)
/*
* Return TRUE if "buf" is the quickfix buffer.
*/
{
return buf != NULL && buf->b_p_bt[0] == 'q';
}
+#endif
+#if defined(FEAT_TERMINAL) || defined(PROTO)
/*
* Return TRUE if "buf" is a terminal buffer.
*/
{
return buf != NULL && buf->b_p_bt[0] == 't';
}
+#endif
/*
* Return TRUE if "buf" is a help buffer.
|| buf->b_p_bt[0] == 'p');
}
+#if defined(FEAT_QUICKFIX) || defined(PROTO)
int
bt_dontwrite_msg(buf_T *buf)
{
}
return FALSE;
}
+#endif
/*
* Return TRUE if the buffer should be hidden, according to 'hidden', ":hide"
return TRUE;
}
+#if defined(FEAT_NETBEANS_INTG) || defined(PROTO)
/*
* Return TRUE when channel "channel" is open for writing to.
* Also returns FALSE or invalid "channel".
return channel != NULL && (channel->CH_SOCK_FD != INVALID_FD
|| channel->CH_IN_FD != INVALID_FD);
}
+#endif
/*
* Return TRUE when channel "channel" is open for reading or writing.
# endif
# endif
-#if defined(FEAT_SYN_HL) && defined(FEAT_RELTIME) && defined(FEAT_FLOAT)
+#if defined(FEAT_SYN_HL) && defined(FEAT_RELTIME) && defined(FEAT_FLOAT) && defined(FEAT_PROFILE)
# if defined(HAVE_MATH_H)
# include <math.h>
# endif
}
#endif
+#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
char_u *
get_mapclear_arg(expand_T *xp UNUSED, int idx)
{
return (char_u *)"<buffer>";
return NULL;
}
+#endif
static int filetype_detect = FALSE;
static int filetype_plugin = FALSE;
return (first_autopat[(int)EVENT_CURSORMOVED] != NULL);
}
+#if defined(FEAT_CONCEAL) || defined(PROTO)
/*
* Return TRUE when there is a CursorMovedI autocommand defined.
*/
{
return (first_autopat[(int)EVENT_CURSORMOVEDI] != NULL);
}
+#endif
/*
* Return TRUE when there is a TextChanged autocommand defined.
return (first_autopat[(int)EVENT_TEXTCHANGEDI] != NULL);
}
+#if defined(FEAT_INS_EXPAND) || defined(PROTO)
/*
* Return TRUE when there is a TextChangedP autocommand defined.
*/
{
return (first_autopat[(int)EVENT_TEXTCHANGEDP] != NULL);
}
+#endif
/*
* Return TRUE when there is an InsertCharPre autocommand defined.
return (first_autopat[(int)EVENT_FUNCUNDEFINED] != NULL);
}
+#if defined(FEAT_EVAL) || defined(PROTO)
/*
* Return TRUE when there is a TextYankPost autocommand defined.
*/
{
return (first_autopat[(int)EVENT_TEXTYANKPOST] != NULL);
}
+#endif
/*
* Execute autocommands for "event" and file name "fname".
# endif
}
+#if defined(FEAT_EVAL) && (defined(FEAT_XIM) || defined(IME_WITHOUT_XIM)) \
+ || defined(PROTO)
int
is_autocmd_blocked(void)
{
return autocmd_blocked != 0;
}
+#endif
/*
* Find next autocommand pattern that matches.
#endif /* FEAT_CMDL_COMPL */
+#if defined(FEAT_EVAL) || defined(PROTO)
/*
* Return TRUE if autocmd is supported.
*/
vim_free(arg_save);
return retval;
}
+#endif
/*
&& readbuf2.bh_first.b_next == NULL);
}
+#if defined(FEAT_EVAL) || defined(PROTO)
/*
* Return TRUE if readbuf1 is empty. There may still be redo characters in
* redbuf2.
{
return (readbuf1.bh_first.b_next == NULL);
}
+#endif
/*
* Set a typeahead character that won't be flushed.
{
}
+#if (defined(FEAT_XCLIPBOARD) && defined(USE_SYSTEM)) || defined(PROTO)
int
clip_gtk_owner_exists(VimClipboard *cbd)
{
return gdk_selection_owner_get(cbd->gtk_sel_atom) != NULL;
}
+#endif
#if defined(FEAT_MENU) || defined(PROTO)
vim_free(ht->ht_array);
}
+#if defined(FEAT_SPELL) || defined(PROTO)
/*
* Free the array of a hash table and all the keys it contains. The keys must
* have been allocated. "off" is the offset from the start of the allocate
}
hash_clear(ht);
}
+#endif
/*
* Find "key" in hashtable "ht". "key" must not be NULL.
}
}
+#if defined(FEAT_EVAL) || defined(FEAT_SYN_HL) || defined(PROTO)
/*
* Print the efficiency of hashtable lookups.
* Useful when trying different hash algorithms.
hash_count_perturb * 100 / hash_count_lookup);
#endif
}
+#endif
/*
* Add item with key "key" to hashtable "ht".
return ga.ga_data;
}
+#if defined(FEAT_JOB_CHANNEL) || defined(PROTO)
/*
* Encode ["nr", "val"] into a JSON format string in allocated memory.
* "options" can contain JSON_JS, JSON_NO_NONE and JSON_NL.
list_unref(listtv.vval.v_list);
return ga.ga_data;
}
+#endif
static void
write_string(garray_T *gap, char_u *str)
return OK;
}
+#if defined(FEAT_JOB_CHANNEL) || defined(PROTO)
/*
* Decode the JSON from "reader" and store the result in "res".
* "options" can be JSON_JS or zero;
return ret;
}
+#endif
/*
* Decode the JSON from "reader" to find the end of the message.
return n;
}
+#if defined(FEAT_QUICKFIX) || defined(PROTO)
/*
* Remove all BOM from "s" by moving remaining text.
*/
}
}
}
+#endif
/*
* Get class of pointer:
--no_wait_return;
}
+#if defined(FEAT_EVAL) || defined(PROTO)
void
give_warning2(char_u *message, char_u *a1, int hl)
{
vim_snprintf((char *)IObuff, IOSIZE, (char *)message, a1);
give_warning(IObuff, hl);
}
+#endif
/*
* Advance msg cursor to column "col".
return pend;
}
+#if defined(FEAT_EVAL) || defined(PROTO)
void
vim_unsetenv(char_u *var)
{
vim_setenv(var, (char_u *)"");
#endif
}
+#endif
/*
/*
* lalloc() with an ID for alloc_fail().
*/
+#if defined(FEAT_SIGNS) || defined(PROTO)
char_u *
lalloc_id(long_u size, int message, alloc_id_T id UNUSED)
{
#endif
return (lalloc((long_u)size, message));
}
+#endif
#if defined(MEM_PROFILE) || defined(PROTO)
/*
return OK;
}
+#if defined(FEAT_EVAL) || defined(FEAT_SEARCHPATH) || defined(PROTO)
/*
* For a growing array that contains a list of strings: concatenate all the
* strings with a separating "sep".
}
return s;
}
+#endif
#if defined(FEAT_VIMINFO) || defined(FEAT_EVAL) || defined(PROTO)
/*
return opchars[op][2] & OPF_LINES;
}
+#if defined(FEAT_JOB_CHANNEL) || defined(PROTO)
/*
* Return TRUE if operator "op" changes text.
*/
{
return opchars[op][2] & OPF_CHANGE;
}
+#endif
/*
* Get first operator command character.
#endif
}
+#if (defined(FEAT_CLIPBOARD) && defined(FEAT_X11) && defined(USE_SYSTEM)) \
+ || defined(PROTO)
void
free_register(void *reg)
{
vim_free(reg);
*y_current = tmp;
}
+#endif
#if defined(FEAT_MOUSE) || defined(PROTO)
/*
#endif
}
+#if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) || defined(PROTO)
/*
* Unset local option value, similar to ":set opt<".
*/
#endif
}
}
+#endif
/*
* Get pointer to option variable, depending on local or global scope.
return TRUE;
}
+#if defined(FEAT_BEVAL) || defined(PROTO)
/*
* Copy a tabstop array, allocating space for the new array.
*/
return newts;
}
+#endif
/*
* Return a count of the number of tabstops.
* Returns OK for normal return, FAIL when the protected code caused a
* problem and LONGJMP() was used.
*/
- void
+ static void
mch_startjmp(void)
{
#ifdef SIGHASARG
lc_active = TRUE;
}
- void
+ static void
mch_endjmp(void)
{
lc_active = FALSE;
}
- void
+ static void
mch_didjmp(void)
{
# if defined(HAVE_SIGALTSTACK) || defined(HAVE_SIGSTACK)
long_u mch_total_mem(int special);
void mch_delay(long msec, int ignoreinput);
int mch_stackcheck(char *p);
-void mch_startjmp(void);
-void mch_endjmp(void);
-void mch_didjmp(void);
void mch_suspend(void);
void mch_init(void);
void reset_signals(void);
/* regexp.c */
int re_multiline(regprog_T *prog);
-int re_lookbehind(regprog_T *prog);
char_u *skip_regexp(char_u *startp, int dirc, int magic, char_u **newp);
int vim_regcomp_had_eol(void);
void free_regexp_stuff(void);
int term_use_loop(void);
void term_win_entered(void);
int terminal_loop(int blocking);
-void term_job_ended(job_T *job);
void term_channel_closed(channel_T *ch);
void term_check_channel_closed_recently(void);
int term_do_update_window(win_T *wp);
return (prog->regflags & RF_HASNL);
}
-/*
- * Return TRUE if compiled regular expression "prog" looks before the start
- * position (pattern contains "\@<=" or "\@<!").
- */
- int
-re_lookbehind(regprog_T *prog)
-{
- return (prog->regflags & RF_LOOKBH);
-}
-
/*
* Check for an equivalence class name "[=a=]". "pp" points to the '['.
* Returns a character representing the class. Zero means that no item was
}
#endif
+#if (defined(FEAT_X11) && (defined(FEAT_TITLE) || defined(FEAT_XCLIPBOARD))) \
+ || defined(PROTO)
/*
* Return whether "prog" is currently being executed.
*/
{
return prog->re_in_use;
}
+#endif
/*
* Match a regexp against a string.
}
}
+#if defined(FEAT_SIGNS) || defined(PROTO)
void
redraw_buf_line_later(buf_T *buf, linenr_T lnum)
{
&& lnum < wp->w_botline)
redrawWinline(wp, lnum);
}
+#endif
+#if defined(FEAT_JOB_CHANNEL) || defined(PROTO)
void
redraw_buf_and_status_later(buf_T *buf, int type)
{
}
}
}
+#endif
+#if defined(FEAT_TERMRESPONSE) || defined(PROTO)
/*
* Redraw as soon as possible. When the command line is not scrolled redraw
* right away and restore what was on the command line.
return ret;
}
+#endif
/*
* Invoked after an asynchronous callback is called.
}
#endif
-#if defined(FEAT_SIGNS) || defined(PROTO)
+#if defined(FEAT_NETBEANS_INTG) || defined(PROTO)
void
update_debug_sign(buf_T *buf, linenr_T lnum)
{
}
#endif
+#if defined(FEAT_EVAL) || defined(PROTO)
/*
* Return the current cursor column. This is the actual position on the
* screen. First column is 0.
{
return screen_cur_row;
}
+#endif
return FALSE;
}
+#if defined(FEAT_EVAL) || defined(PROTO)
char_u *
last_csearch(void)
{
vim_memset(lastc_bytes, 0, sizeof(lastc_bytes));
#endif
}
+#endif
void
set_csearch_direction(int cdir)
return (table->ga_len - 1 + ATTR_OFF);
}
+#if defined(FEAT_TERMINAL) || defined(PROTO)
/*
* Get an attribute index for a cterm entry.
* Uses an existing entry when possible or adds one when needed.
at_en.ae_u.cterm.bg_color = bg;
return get_attr_entry(&cterm_attr_table, &at_en);
}
+#endif
-#if defined(FEAT_TERMGUICOLORS) || defined(PROTO)
+#if (defined(FEAT_TERMINAL) && defined(FEAT_TERMGUICOLORS)) || defined(PROTO)
/*
* Get an attribute index for a 'termguicolors' entry.
* Uses an existing entry when possible or adds one when needed.
}
#endif
-#if defined(FEAT_GUI) || defined(PROTO)
+#if (defined(FEAT_TERMINAL) && defined(FEAT_GUI)) || defined(PROTO)
/*
* Get an attribute index for a cterm entry.
* Uses an existing entry when possible or adds one when needed.
static int winpos_y = -1;
static int did_request_winpos = 0;
+# if (defined(FEAT_EVAL) && defined(HAVE_TGETENT)) || defined(PROTO)
/*
* Try getting the Vim window position from the terminal.
* Returns OK or FAIL.
return FALSE;
}
+# endif
# endif
void
return ret;
}
-/*
- * Called when a job has finished.
- * This updates the title and status, but does not close the vterm, because
- * there might still be pending output in the channel.
- */
- void
-term_job_ended(job_T *job)
-{
- term_T *term;
- int did_one = FALSE;
-
- for (term = first_term; term != NULL; term = term->tl_next)
- if (term->tl_job == job)
- {
- VIM_CLEAR(term->tl_title);
- VIM_CLEAR(term->tl_status_text);
- redraw_buf_and_status_later(term->tl_buffer, VALID);
- did_one = TRUE;
- }
- if (did_one)
- redraw_statuslines();
- if (curbuf->b_term != NULL)
- {
- if (curbuf->b_term->tl_job == job)
- maketitle();
- update_cursor(curbuf->b_term, TRUE);
- }
-}
-
static void
may_toggle_cursor(term_T *term)
{
p_more = FALSE;
msg_row = Rows - 1;
- msg_puts((char_u *)"\n");
+ msg_puts("\n");
p_more = save_p_more;
--term->tl_toprow;
}
}
}
+#if defined(FEAT_GUI) || defined(PROTO)
job_T *
term_getjob(term_T *term)
{
return term != NULL ? term->tl_job : NULL;
}
+#endif
# if defined(WIN3264) || defined(PROTO)
#endif
}
+#if (defined(FEAT_X11) && defined(USE_SYSTEM)) || defined(PROTO)
int
clip_gen_owner_exists(VimClipboard *cbd UNUSED)
{
return TRUE;
#endif
}
+#endif
#endif /* FEAT_CLIPBOARD */
{
}
+#if (defined(FEAT_X11) && defined(FEAT_XCLIPBOARD) && defined(USE_SYSTEM)) \
+ || defined(PROTO)
int
clip_x11_owner_exists(VimClipboard *cbd)
{
return XGetSelectionOwner(X_DISPLAY, cbd->sel_atom) != None;
}
#endif
+#endif
#if defined(FEAT_XCLIPBOARD) || defined(FEAT_GUI_X11) \
|| defined(FEAT_GUI_GTK) || defined(PROTO)
return n;
}
+#if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) || defined(PROTO)
char_u *
get_expanded_name(char_u *name, int check)
{
vim_free(p);
return NULL;
}
+#endif
#if defined(FEAT_PROFILE) || defined(PROTO)
/*
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 785,
/**/
784,
/**/