aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFelipe Oliveira Carvalho <felipekde@gmail.com>2014-03-10 02:02:40 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-03-10 05:55:59 -0300
commit3cac32e49c7fae9cf5963d35f3fd3052c061b2fa (patch)
treeb62282c3caa75fefd33d63d272893a0cdbc92fb0 /src
parent1684bec63571583f14065cfb614153df125b97e8 (diff)
downloadrneovim-3cac32e49c7fae9cf5963d35f3fd3052c061b2fa.tar.gz
rneovim-3cac32e49c7fae9cf5963d35f3fd3052c061b2fa.tar.bz2
rneovim-3cac32e49c7fae9cf5963d35f3fd3052c061b2fa.zip
Remove CURSOR_SHAPE #ifdef tests
See issue #333
Diffstat (limited to 'src')
-rw-r--r--src/cursor_shape.c8
-rw-r--r--src/cursor_shape.h2
-rw-r--r--src/edit.c6
-rw-r--r--src/eval.c2
-rw-r--r--src/ex_getln.c15
-rw-r--r--src/normal.c12
-rw-r--r--src/option.c11
-rw-r--r--src/option_defs.h2
-rw-r--r--src/search.c6
-rw-r--r--src/term.c3
-rw-r--r--src/ui.c3
-rw-r--r--src/version.c4
12 files changed, 2 insertions, 72 deletions
diff --git a/src/cursor_shape.c b/src/cursor_shape.c
index 6ee1b237a0..1e49cb3f43 100644
--- a/src/cursor_shape.c
+++ b/src/cursor_shape.c
@@ -1,11 +1,10 @@
#include "vim.h"
#include "cursor_shape.h"
#include "misc2.h"
+#include "ex_getln.h"
#include "charset.h"
#include "syntax.h"
-#if defined(CURSOR_SHAPE) || defined(PROTO)
-
/*
* Handling of cursor and mouse pointer shapes in various modes.
*/
@@ -209,8 +208,6 @@ char_u *parse_shape_opt(int what)
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.
* 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;
}
-#endif
-
-#endif /* CURSOR_SHAPE */
diff --git a/src/cursor_shape.h b/src/cursor_shape.h
index 41c15d0205..51560554f1 100644
--- a/src/cursor_shape.h
+++ b/src/cursor_shape.h
@@ -1,7 +1,6 @@
#ifndef NEOVIM_CURSOR_SHAPE_H
#define NEOVIM_CURSOR_SHAPE_H
-#ifdef CURSOR_SHAPE
/*
* struct to store values from 'guicursor' and 'mouseshape'
*/
@@ -47,7 +46,6 @@ typedef struct cursor_entry {
char *name; /* mode name (fixed) */
char used_for; /* SHAPE_MOUSE and/or SHAPE_CURSOR */
} cursorentry_T;
-#endif /* CURSOR_SHAPE */
char_u *parse_shape_opt(int what);
int get_shape_idx(int mouse);
diff --git a/src/edit.c b/src/edit.c
index de97fdad0f..aa79302497 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -547,9 +547,7 @@ edit (
if (!p_im && did_restart_edit == 0)
change_warning(i == 0 ? 0 : i + 1);
-#ifdef CURSOR_SHAPE
ui_cursor_shape(); /* may show different cursor shape */
-#endif
do_digraph(-1); /* clear digraphs */
/*
@@ -7074,9 +7072,7 @@ ins_esc (
changed_cline_bef_curs();
setmouse();
-#ifdef CURSOR_SHAPE
ui_cursor_shape(); /* may show different cursor shape */
-#endif
/*
* 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);
AppendCharToRedobuff(K_INS);
showmode();
-#ifdef CURSOR_SHAPE
ui_cursor_shape(); /* may show different cursor shape */
-#endif
}
/*
diff --git a/src/eval.c b/src/eval.c
index aeda008129..b164912c1c 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -10227,9 +10227,7 @@ static void f_has(typval_T *argvars, typval_T *rettv)
"cryptv",
"cscope",
"cursorbind",
-#ifdef CURSOR_SHAPE
"cursorshape",
-#endif
#ifdef DEBUG
"debug",
#endif
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 3b188f1a20..aad9993354 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -294,9 +294,7 @@ getcmdline (
#endif
setmouse();
-#ifdef CURSOR_SHAPE
ui_cursor_shape(); /* may show different cursor shape */
-#endif
/* When inside an autocommand for writing "exiting" may be set and
* terminal mode set to cooked. Need to set raw mode here then. */
@@ -866,9 +864,8 @@ getcmdline (
beep_flush();
else
ccline.overstrike = !ccline.overstrike;
-#ifdef CURSOR_SHAPE
+
ui_cursor_shape(); /* may show different cursor shape */
-#endif
goto cmdline_not_changed;
case Ctrl_HAT:
@@ -908,9 +905,7 @@ getcmdline (
else
set_imsearch_global();
}
-#ifdef CURSOR_SHAPE
ui_cursor_shape(); /* may show different cursor shape */
-#endif
/* Show/unshow value of 'keymap' in status lines later. */
status_redraw_curbuf();
goto cmdline_not_changed;
@@ -1563,9 +1558,7 @@ returncmd:
im_set_active(FALSE);
#endif
setmouse();
-#ifdef CURSOR_SHAPE
ui_cursor_shape(); /* may show different cursor shape */
-#endif
{
char_u *p = ccline.cmdbuff;
@@ -1967,8 +1960,6 @@ redraw:
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.
*/
@@ -1983,10 +1974,6 @@ int cmdline_at_end(void) {
return ccline.cmdpos >= ccline.cmdlen;
}
-#endif
-
-
-
/*
* Allocate a new command line buffer.
* Assigns the new buffer to ccline.cmdbuff and ccline.cmdbufflen.
diff --git a/src/normal.c b/src/normal.c
index 7e9a0c1781..3cd8159786 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -532,15 +532,11 @@ normal_cmd (
* will terminate it. Finish_op tells us to finish the operation before
* returning this time (unless the operation was cancelled).
*/
-#ifdef CURSOR_SHAPE
c = finish_op;
-#endif
finish_op = (oap->op_type != OP_NOP);
-#ifdef CURSOR_SHAPE
if (finish_op != c) {
ui_cursor_shape(); /* may show different cursor shape */
}
-#endif
/* When not finishing an operator and no register name typed, reset the
* count. */
@@ -836,12 +832,10 @@ getcount:
* Get a second or third character.
*/
if (cp != NULL) {
-#ifdef CURSOR_SHAPE
if (repl) {
State = REPLACE; /* pretend Replace mode */
ui_cursor_shape(); /* show different cursor shape */
}
-#endif
if (lang && curbuf->b_p_iminsert == B_IMODE_LMAP) {
/* Allow mappings defined with ":lmap". */
--no_mapping;
@@ -875,9 +869,7 @@ getcount:
}
p_smd = save_smd;
#endif
-#ifdef CURSOR_SHAPE
State = NORMAL_BUSY;
-#endif
need_flushbuf |= add_to_showcmd(*cp);
if (!lit) {
@@ -1107,17 +1099,13 @@ normal_end:
msg_nowait = FALSE;
/* Reset finish_op, in case it was set */
-#ifdef CURSOR_SHAPE
c = finish_op;
-#endif
finish_op = FALSE;
-#ifdef CURSOR_SHAPE
/* Redraw the cursor with another shape, if we were in Operator-pending
* mode or did a replace command. */
if (c || ca.cmdchar == 'r') {
ui_cursor_shape(); /* may show different cursor shape */
}
-#endif
if (oap->op_type == OP_NOP && oap->regname == 0
&& ca.cmdchar != K_CURSORHOLD
diff --git a/src/option.c b/src/option.c
index 4fb498a0bc..b76c84cdeb 100644
--- a/src/option.c
+++ b/src/option.c
@@ -828,16 +828,11 @@ static struct vimoption
}
SCRIPTID_INIT},
{"guicursor", "gcr", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
-#ifdef CURSOR_SHAPE
(char_u *)&p_guicursor, PV_NONE,
{
(char_u *)"n-v-c:block,o:hor50,i-ci:hor15,r-cr:hor30,sm:block",
(char_u *)0L
}
-#else
- (char_u *)NULL, PV_NONE,
- {(char_u *)NULL, (char_u *)0L}
-#endif
SCRIPTID_INIT},
{"guifont", "gfn", P_STRING|P_VI_DEF|P_RCLR|P_COMMA|P_NODUP,
(char_u *)NULL, PV_NONE,
@@ -2424,9 +2419,7 @@ void set_init_2(void) {
options[idx].flags &= ~P_WAS_SET;
}
-#ifdef CURSOR_SHAPE
parse_shape_opt(SHAPE_CURSOR); /* set cursor shapes from 'guicursor' */
-#endif
(void)parse_printoptions(); /* parse 'printoptions' default value */
}
@@ -4405,13 +4398,9 @@ did_set_string_option (
}
}
-
-#ifdef CURSOR_SHAPE
/* 'guicursor' */
else if (varp == &p_guicursor)
errmsg = parse_shape_opt(SHAPE_CURSOR);
-#endif
-
else if (varp == &p_popt)
errmsg = parse_printoptions();
diff --git a/src/option_defs.h b/src/option_defs.h
index 47deac8959..19eb06e337 100644
--- a/src/option_defs.h
+++ b/src/option_defs.h
@@ -397,9 +397,7 @@ EXTERN char_u *p_pfn; /* 'printfont' */
EXTERN char_u *p_popt; /* 'printoptions' */
EXTERN char_u *p_header; /* 'printheader' */
EXTERN int p_prompt; /* 'prompt' */
-#ifdef CURSOR_SHAPE
EXTERN char_u *p_guicursor; /* 'guicursor' */
-#endif
EXTERN char_u *p_hf; /* 'helpfile' */
EXTERN long p_hh; /* 'helpheight' */
EXTERN char_u *p_hlg; /* 'helplang' */
diff --git a/src/search.c b/src/search.c
index 1cec595e25..0bf3e8645e 100644
--- a/src/search.c
+++ b/src/search.c
@@ -2000,9 +2000,7 @@ showmatch (
colnr_T vcol;
long save_so;
long save_siso;
-#ifdef CURSOR_SHAPE
int save_state;
-#endif
colnr_T save_dollar_vcol;
char_u *p;
@@ -2042,11 +2040,9 @@ showmatch (
update_screen(VALID); /* show the new char first */
save_dollar_vcol = dollar_vcol;
-#ifdef CURSOR_SHAPE
save_state = State;
State = SHOWMATCH;
ui_cursor_shape(); /* may show different cursor shape */
-#endif
curwin->w_cursor = mpos; /* move to matching char */
p_so = 0; /* don't use 'scrolloff' here */
p_siso = 0; /* don't use 'sidescrolloff' here */
@@ -2070,10 +2066,8 @@ showmatch (
curwin->w_cursor = save_cursor; /* restore cursor position */
p_so = save_so;
p_siso = save_siso;
-#ifdef CURSOR_SHAPE
State = save_state;
ui_cursor_shape(); /* may show different cursor shape */
-#endif
}
}
}
diff --git a/src/term.c b/src/term.c
index 4e405f732a..398df0af79 100644
--- a/src/term.c
+++ b/src/term.c
@@ -2890,7 +2890,6 @@ void cursor_off(void) {
}
}
-#if defined(CURSOR_SHAPE) || defined(PROTO)
/*
* Set cursor shape to match Insert mode.
*/
@@ -2911,8 +2910,6 @@ void term_cursor_shape(void) {
}
}
-#endif
-
/*
* Set scrolling region for window 'wp'.
* The region starts 'off' lines from the start of the window.
diff --git a/src/ui.c b/src/ui.c
index e864de9dd8..1ea5ef3eb1 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -579,7 +579,6 @@ void read_error_exit(void) {
preserve_exit();
}
-#if defined(CURSOR_SHAPE) || defined(PROTO)
/*
* May update the shape of the cursor.
*/
@@ -590,8 +589,6 @@ void ui_cursor_shape(void) {
conceal_check_cursur_line();
}
-#endif
-
#if defined(FEAT_CLIPBOARD) || defined(FEAT_GUI) || defined(FEAT_RIGHTLEFT) \
|| defined(FEAT_MBYTE) || defined(PROTO)
/*
diff --git a/src/version.c b/src/version.c
index 085ce49823..9fbe15a038 100644
--- a/src/version.c
+++ b/src/version.c
@@ -73,11 +73,7 @@ static char *(features[]) =
"+cryptv",
"+cscope",
"+cursorbind",
-#ifdef CURSOR_SHAPE
"+cursorshape",
-#else
- "-cursorshape",
-#endif
"+dialog_con",
"+diff",
"+digraphs",