Remove CURSOR_SHAPE #ifdef tests

See issue #333
This commit is contained in:
Felipe Oliveira Carvalho 2014-03-10 02:02:40 -03:00 committed by Thiago de Arruda
parent 1684bec635
commit 3cac32e49c
12 changed files with 2 additions and 72 deletions

View File

@ -1,11 +1,10 @@
#include "vim.h" #include "vim.h"
#include "cursor_shape.h" #include "cursor_shape.h"
#include "misc2.h" #include "misc2.h"
#include "ex_getln.h"
#include "charset.h" #include "charset.h"
#include "syntax.h" #include "syntax.h"
#if defined(CURSOR_SHAPE) || defined(PROTO)
/* /*
* Handling of cursor and mouse pointer shapes in various modes. * Handling of cursor and mouse pointer shapes in various modes.
*/ */
@ -209,8 +208,6 @@ char_u *parse_shape_opt(int what)
return NULL; return NULL;
} }
# if defined(MCH_CURSOR_SHAPE) || defined(FEAT_GUI) \
|| defined(FEAT_MOUSESHAPE) || defined(PROTO)
/* /*
* Return the index into shape_table[] for the current mode. * Return the index into shape_table[] for the current mode.
* When "mouse" is TRUE, consider indexes valid for the mouse pointer. * When "mouse" is TRUE, consider indexes valid for the mouse pointer.
@ -242,6 +239,3 @@ int get_shape_idx(int mouse)
} }
return SHAPE_IDX_N; return SHAPE_IDX_N;
} }
#endif
#endif /* CURSOR_SHAPE */

View File

@ -1,7 +1,6 @@
#ifndef NEOVIM_CURSOR_SHAPE_H #ifndef NEOVIM_CURSOR_SHAPE_H
#define NEOVIM_CURSOR_SHAPE_H #define NEOVIM_CURSOR_SHAPE_H
#ifdef CURSOR_SHAPE
/* /*
* struct to store values from 'guicursor' and 'mouseshape' * struct to store values from 'guicursor' and 'mouseshape'
*/ */
@ -47,7 +46,6 @@ typedef struct cursor_entry {
char *name; /* mode name (fixed) */ char *name; /* mode name (fixed) */
char used_for; /* SHAPE_MOUSE and/or SHAPE_CURSOR */ char used_for; /* SHAPE_MOUSE and/or SHAPE_CURSOR */
} cursorentry_T; } cursorentry_T;
#endif /* CURSOR_SHAPE */
char_u *parse_shape_opt(int what); char_u *parse_shape_opt(int what);
int get_shape_idx(int mouse); int get_shape_idx(int mouse);

View File

@ -547,9 +547,7 @@ edit (
if (!p_im && did_restart_edit == 0) if (!p_im && did_restart_edit == 0)
change_warning(i == 0 ? 0 : i + 1); change_warning(i == 0 ? 0 : i + 1);
#ifdef CURSOR_SHAPE
ui_cursor_shape(); /* may show different cursor shape */ ui_cursor_shape(); /* may show different cursor shape */
#endif
do_digraph(-1); /* clear digraphs */ do_digraph(-1); /* clear digraphs */
/* /*
@ -7074,9 +7072,7 @@ ins_esc (
changed_cline_bef_curs(); changed_cline_bef_curs();
setmouse(); setmouse();
#ifdef CURSOR_SHAPE
ui_cursor_shape(); /* may show different cursor shape */ ui_cursor_shape(); /* may show different cursor shape */
#endif
/* /*
* When recording or for CTRL-O, need to display the new mode. * When recording or for CTRL-O, need to display the new mode.
@ -7190,9 +7186,7 @@ static void ins_insert(int replaceState)
State = replaceState | (State & LANGMAP); State = replaceState | (State & LANGMAP);
AppendCharToRedobuff(K_INS); AppendCharToRedobuff(K_INS);
showmode(); showmode();
#ifdef CURSOR_SHAPE
ui_cursor_shape(); /* may show different cursor shape */ ui_cursor_shape(); /* may show different cursor shape */
#endif
} }
/* /*

View File

@ -10227,9 +10227,7 @@ static void f_has(typval_T *argvars, typval_T *rettv)
"cryptv", "cryptv",
"cscope", "cscope",
"cursorbind", "cursorbind",
#ifdef CURSOR_SHAPE
"cursorshape", "cursorshape",
#endif
#ifdef DEBUG #ifdef DEBUG
"debug", "debug",
#endif #endif

View File

@ -294,9 +294,7 @@ getcmdline (
#endif #endif
setmouse(); setmouse();
#ifdef CURSOR_SHAPE
ui_cursor_shape(); /* may show different cursor shape */ ui_cursor_shape(); /* may show different cursor shape */
#endif
/* When inside an autocommand for writing "exiting" may be set and /* When inside an autocommand for writing "exiting" may be set and
* terminal mode set to cooked. Need to set raw mode here then. */ * terminal mode set to cooked. Need to set raw mode here then. */
@ -866,9 +864,8 @@ getcmdline (
beep_flush(); beep_flush();
else else
ccline.overstrike = !ccline.overstrike; ccline.overstrike = !ccline.overstrike;
#ifdef CURSOR_SHAPE
ui_cursor_shape(); /* may show different cursor shape */ ui_cursor_shape(); /* may show different cursor shape */
#endif
goto cmdline_not_changed; goto cmdline_not_changed;
case Ctrl_HAT: case Ctrl_HAT:
@ -908,9 +905,7 @@ getcmdline (
else else
set_imsearch_global(); set_imsearch_global();
} }
#ifdef CURSOR_SHAPE
ui_cursor_shape(); /* may show different cursor shape */ ui_cursor_shape(); /* may show different cursor shape */
#endif
/* Show/unshow value of 'keymap' in status lines later. */ /* Show/unshow value of 'keymap' in status lines later. */
status_redraw_curbuf(); status_redraw_curbuf();
goto cmdline_not_changed; goto cmdline_not_changed;
@ -1563,9 +1558,7 @@ returncmd:
im_set_active(FALSE); im_set_active(FALSE);
#endif #endif
setmouse(); setmouse();
#ifdef CURSOR_SHAPE
ui_cursor_shape(); /* may show different cursor shape */ ui_cursor_shape(); /* may show different cursor shape */
#endif
{ {
char_u *p = ccline.cmdbuff; char_u *p = ccline.cmdbuff;
@ -1967,8 +1960,6 @@ redraw:
return (char_u *)line_ga.ga_data; return (char_u *)line_ga.ga_data;
} }
# if defined(MCH_CURSOR_SHAPE) || defined(FEAT_GUI) \
|| defined(FEAT_MOUSESHAPE) || defined(PROTO)
/* /*
* Return TRUE if ccline.overstrike is on. * Return TRUE if ccline.overstrike is on.
*/ */
@ -1983,10 +1974,6 @@ int cmdline_at_end(void) {
return ccline.cmdpos >= ccline.cmdlen; return ccline.cmdpos >= ccline.cmdlen;
} }
#endif
/* /*
* Allocate a new command line buffer. * Allocate a new command line buffer.
* Assigns the new buffer to ccline.cmdbuff and ccline.cmdbufflen. * Assigns the new buffer to ccline.cmdbuff and ccline.cmdbufflen.

View File

@ -532,15 +532,11 @@ normal_cmd (
* will terminate it. Finish_op tells us to finish the operation before * will terminate it. Finish_op tells us to finish the operation before
* returning this time (unless the operation was cancelled). * returning this time (unless the operation was cancelled).
*/ */
#ifdef CURSOR_SHAPE
c = finish_op; c = finish_op;
#endif
finish_op = (oap->op_type != OP_NOP); finish_op = (oap->op_type != OP_NOP);
#ifdef CURSOR_SHAPE
if (finish_op != c) { if (finish_op != c) {
ui_cursor_shape(); /* may show different cursor shape */ ui_cursor_shape(); /* may show different cursor shape */
} }
#endif
/* When not finishing an operator and no register name typed, reset the /* When not finishing an operator and no register name typed, reset the
* count. */ * count. */
@ -836,12 +832,10 @@ getcount:
* Get a second or third character. * Get a second or third character.
*/ */
if (cp != NULL) { if (cp != NULL) {
#ifdef CURSOR_SHAPE
if (repl) { if (repl) {
State = REPLACE; /* pretend Replace mode */ State = REPLACE; /* pretend Replace mode */
ui_cursor_shape(); /* show different cursor shape */ ui_cursor_shape(); /* show different cursor shape */
} }
#endif
if (lang && curbuf->b_p_iminsert == B_IMODE_LMAP) { if (lang && curbuf->b_p_iminsert == B_IMODE_LMAP) {
/* Allow mappings defined with ":lmap". */ /* Allow mappings defined with ":lmap". */
--no_mapping; --no_mapping;
@ -875,9 +869,7 @@ getcount:
} }
p_smd = save_smd; p_smd = save_smd;
#endif #endif
#ifdef CURSOR_SHAPE
State = NORMAL_BUSY; State = NORMAL_BUSY;
#endif
need_flushbuf |= add_to_showcmd(*cp); need_flushbuf |= add_to_showcmd(*cp);
if (!lit) { if (!lit) {
@ -1107,17 +1099,13 @@ normal_end:
msg_nowait = FALSE; msg_nowait = FALSE;
/* Reset finish_op, in case it was set */ /* Reset finish_op, in case it was set */
#ifdef CURSOR_SHAPE
c = finish_op; c = finish_op;
#endif
finish_op = FALSE; finish_op = FALSE;
#ifdef CURSOR_SHAPE
/* Redraw the cursor with another shape, if we were in Operator-pending /* Redraw the cursor with another shape, if we were in Operator-pending
* mode or did a replace command. */ * mode or did a replace command. */
if (c || ca.cmdchar == 'r') { if (c || ca.cmdchar == 'r') {
ui_cursor_shape(); /* may show different cursor shape */ ui_cursor_shape(); /* may show different cursor shape */
} }
#endif
if (oap->op_type == OP_NOP && oap->regname == 0 if (oap->op_type == OP_NOP && oap->regname == 0
&& ca.cmdchar != K_CURSORHOLD && ca.cmdchar != K_CURSORHOLD

View File

@ -828,16 +828,11 @@ static struct vimoption
} }
SCRIPTID_INIT}, SCRIPTID_INIT},
{"guicursor", "gcr", P_STRING|P_VI_DEF|P_COMMA|P_NODUP, {"guicursor", "gcr", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
#ifdef CURSOR_SHAPE
(char_u *)&p_guicursor, PV_NONE, (char_u *)&p_guicursor, PV_NONE,
{ {
(char_u *)"n-v-c:block,o:hor50,i-ci:hor15,r-cr:hor30,sm:block", (char_u *)"n-v-c:block,o:hor50,i-ci:hor15,r-cr:hor30,sm:block",
(char_u *)0L (char_u *)0L
} }
#else
(char_u *)NULL, PV_NONE,
{(char_u *)NULL, (char_u *)0L}
#endif
SCRIPTID_INIT}, SCRIPTID_INIT},
{"guifont", "gfn", P_STRING|P_VI_DEF|P_RCLR|P_COMMA|P_NODUP, {"guifont", "gfn", P_STRING|P_VI_DEF|P_RCLR|P_COMMA|P_NODUP,
(char_u *)NULL, PV_NONE, (char_u *)NULL, PV_NONE,
@ -2424,9 +2419,7 @@ void set_init_2(void) {
options[idx].flags &= ~P_WAS_SET; options[idx].flags &= ~P_WAS_SET;
} }
#ifdef CURSOR_SHAPE
parse_shape_opt(SHAPE_CURSOR); /* set cursor shapes from 'guicursor' */ parse_shape_opt(SHAPE_CURSOR); /* set cursor shapes from 'guicursor' */
#endif
(void)parse_printoptions(); /* parse 'printoptions' default value */ (void)parse_printoptions(); /* parse 'printoptions' default value */
} }
@ -4405,13 +4398,9 @@ did_set_string_option (
} }
} }
#ifdef CURSOR_SHAPE
/* 'guicursor' */ /* 'guicursor' */
else if (varp == &p_guicursor) else if (varp == &p_guicursor)
errmsg = parse_shape_opt(SHAPE_CURSOR); errmsg = parse_shape_opt(SHAPE_CURSOR);
#endif
else if (varp == &p_popt) else if (varp == &p_popt)
errmsg = parse_printoptions(); errmsg = parse_printoptions();

View File

@ -397,9 +397,7 @@ EXTERN char_u *p_pfn; /* 'printfont' */
EXTERN char_u *p_popt; /* 'printoptions' */ EXTERN char_u *p_popt; /* 'printoptions' */
EXTERN char_u *p_header; /* 'printheader' */ EXTERN char_u *p_header; /* 'printheader' */
EXTERN int p_prompt; /* 'prompt' */ EXTERN int p_prompt; /* 'prompt' */
#ifdef CURSOR_SHAPE
EXTERN char_u *p_guicursor; /* 'guicursor' */ EXTERN char_u *p_guicursor; /* 'guicursor' */
#endif
EXTERN char_u *p_hf; /* 'helpfile' */ EXTERN char_u *p_hf; /* 'helpfile' */
EXTERN long p_hh; /* 'helpheight' */ EXTERN long p_hh; /* 'helpheight' */
EXTERN char_u *p_hlg; /* 'helplang' */ EXTERN char_u *p_hlg; /* 'helplang' */

View File

@ -2000,9 +2000,7 @@ showmatch (
colnr_T vcol; colnr_T vcol;
long save_so; long save_so;
long save_siso; long save_siso;
#ifdef CURSOR_SHAPE
int save_state; int save_state;
#endif
colnr_T save_dollar_vcol; colnr_T save_dollar_vcol;
char_u *p; char_u *p;
@ -2042,11 +2040,9 @@ showmatch (
update_screen(VALID); /* show the new char first */ update_screen(VALID); /* show the new char first */
save_dollar_vcol = dollar_vcol; save_dollar_vcol = dollar_vcol;
#ifdef CURSOR_SHAPE
save_state = State; save_state = State;
State = SHOWMATCH; State = SHOWMATCH;
ui_cursor_shape(); /* may show different cursor shape */ ui_cursor_shape(); /* may show different cursor shape */
#endif
curwin->w_cursor = mpos; /* move to matching char */ curwin->w_cursor = mpos; /* move to matching char */
p_so = 0; /* don't use 'scrolloff' here */ p_so = 0; /* don't use 'scrolloff' here */
p_siso = 0; /* don't use 'sidescrolloff' here */ p_siso = 0; /* don't use 'sidescrolloff' here */
@ -2070,10 +2066,8 @@ showmatch (
curwin->w_cursor = save_cursor; /* restore cursor position */ curwin->w_cursor = save_cursor; /* restore cursor position */
p_so = save_so; p_so = save_so;
p_siso = save_siso; p_siso = save_siso;
#ifdef CURSOR_SHAPE
State = save_state; State = save_state;
ui_cursor_shape(); /* may show different cursor shape */ ui_cursor_shape(); /* may show different cursor shape */
#endif
} }
} }
} }

View File

@ -2890,7 +2890,6 @@ void cursor_off(void) {
} }
} }
#if defined(CURSOR_SHAPE) || defined(PROTO)
/* /*
* Set cursor shape to match Insert mode. * Set cursor shape to match Insert mode.
*/ */
@ -2911,8 +2910,6 @@ void term_cursor_shape(void) {
} }
} }
#endif
/* /*
* Set scrolling region for window 'wp'. * Set scrolling region for window 'wp'.
* The region starts 'off' lines from the start of the window. * The region starts 'off' lines from the start of the window.

View File

@ -579,7 +579,6 @@ void read_error_exit(void) {
preserve_exit(); preserve_exit();
} }
#if defined(CURSOR_SHAPE) || defined(PROTO)
/* /*
* May update the shape of the cursor. * May update the shape of the cursor.
*/ */
@ -590,8 +589,6 @@ void ui_cursor_shape(void) {
conceal_check_cursur_line(); conceal_check_cursur_line();
} }
#endif
#if defined(FEAT_CLIPBOARD) || defined(FEAT_GUI) || defined(FEAT_RIGHTLEFT) \ #if defined(FEAT_CLIPBOARD) || defined(FEAT_GUI) || defined(FEAT_RIGHTLEFT) \
|| defined(FEAT_MBYTE) || defined(PROTO) || defined(FEAT_MBYTE) || defined(PROTO)
/* /*

View File

@ -73,11 +73,7 @@ static char *(features[]) =
"+cryptv", "+cryptv",
"+cscope", "+cscope",
"+cursorbind", "+cursorbind",
#ifdef CURSOR_SHAPE
"+cursorshape", "+cursorshape",
#else
"-cursorshape",
#endif
"+dialog_con", "+dialog_con",
"+diff", "+diff",
"+digraphs", "+digraphs",