" These commands create the option window.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2006 Mar 10
+" Last Change: 2006 Mar 12
" If there already is an option window, jump to that one.
if bufwinnr("option-window") > 0
call append("$", "hlsearch\thighlight all matches for the last used search pattern")
call <SID>BinOptionG("hls", &hls)
if has("syntax")
+ call append("$", "cursorcolumn\thighlight the screen column of the cursor")
+ call append("$", "\t(local to window)")
+ call <SID>BinOptionL("cuc")
+ call append("$", "cursorline\thighlight the screen line of the cursor")
+ call append("$", "\t(local to window)")
+ call <SID>BinOptionL("cul")
call append("$", "spell\thighlight spelling mistakes")
call append("$", "\t(local to window)")
call <SID>BinOptionL("spell")
clear_string_option(&buf->b_p_nf);
#ifdef FEAT_SYN_HL
clear_string_option(&buf->b_p_syn);
+#endif
+#ifdef FEAT_SPELL
clear_string_option(&buf->b_p_spc);
clear_string_option(&buf->b_p_spf);
vim_free(buf->b_cap_prog);
curwin->w_p_fdl = p_fdls;
#endif
-#ifdef FEAT_SYN_HL
+#ifdef FEAT_SPELL
if (curwin->w_p_spell && *buf->b_p_spl != NUL)
did_set_spelllang(buf);
#endif
#endif
#ifndef FEAT_SYN_HL
# define ex_syntax ex_ni
+#endif
+#ifndef FEAT_SPELL
# define ex_spell ex_ni
# define ex_mkspell ex_ni
# define ex_spelldump ex_ni
# endif
}
+#if defined(FEAT_MOUSE) || defined(PROTO)
/*
* Open a new tab page.
*/
ea.arg = (char_u *)"";
ex_splitview(&ea);
}
+#endif
/*
* :tabnext command
exarg_T *eap;
{
no_hlsearch = TRUE;
- redraw_all_later(NOT_VALID);
+ redraw_all_later(SOME_VALID);
}
/*
{
vim_free(curwin->w_match[mi].regprog);
curwin->w_match[mi].regprog = NULL;
- redraw_later(NOT_VALID); /* always need a redraw */
+ redraw_later(SOME_VALID); /* always need a redraw */
}
if (ends_excmd(*eap->arg))
long old_fdl = curwin->w_p_fdl;
int old_fen = curwin->w_p_fen;
#endif
-#ifdef FEAT_SYN_HL
+#ifdef FEAT_SPELL
int undo = FALSE;
#endif
#endif /* FEAT_FOLDING */
-#ifdef FEAT_SYN_HL
+#ifdef FEAT_SPELL
case 'u': /* "zug" and "zuw": undo "zg" and "zw" */
++no_mapping;
++allow_keys; /* no mapping for nchar, but allow key codes */
}
#endif
-#ifdef FEAT_SYN_HL
+#ifdef FEAT_SPELL
/*
* "[s", "[S", "]s" and "]S": move to next spell error.
*/
#include "vim.h"
-#if defined(FEAT_SYN_HL) || defined(PROTO)
+#if defined(FEAT_SPELL) || defined(PROTO)
#ifdef HAVE_FCNTL_H
# include <fcntl.h>
char_u *endp;
hlf_T attr;
int len;
+# ifdef FEAT_SYN_HL
int has_syntax = syntax_present(wp->w_buffer);
int col;
+# endif
int can_spell;
char_u *buf = NULL;
int buflen = 0;
: p - buf)
> wp->w_cursor.col)))
{
+# ifdef FEAT_SYN_HL
if (has_syntax)
{
col = p - buf;
FALSE, &can_spell);
}
else
+#endif
can_spell = TRUE;
if (can_spell)
if (spell_load_file(fname, NULL, slang, FALSE) == NULL)
/* reloading failed, clear the language */
slang_clear(slang);
- redraw_all_later(NOT_VALID);
+ redraw_all_later(SOME_VALID);
didit = TRUE;
}
}
if (buf != NULL)
buf_reload(buf, buf->b_orig_mode);
- redraw_all_later(NOT_VALID);
+ redraw_all_later(SOME_VALID);
}
}
}
#endif
-#endif /* FEAT_SYN_HL */
+#endif /* FEAT_SPELL */
#define INVERTED 20 /* redisplay inverted part that changed */
#define INVERTED_ALL 25 /* redisplay whole inverted part */
#define REDRAW_TOP 30 /* display first w_upd_rows screen lines */
+#define SOME_VALID 35 /* like NOT_VALID but may scroll */
#define NOT_VALID 40 /* buffer needs complete redraw */
#define CLEAR 50 /* screen messed up, clear it */
, HLF_TP /* tabpage line */
, HLF_TPS /* tabpage line selected */
, HLF_TPF /* tabpage line filler */
+ , HLF_CUC /* 'cursurcolumn' */
+ , HLF_CUL /* 'cursurline' */
, HLF_COUNT /* MUST be the last one */
} hlf_T;
-/* the HL_FLAGS must be in the same order as the HLF_ enums! */
+/* The HL_FLAGS must be in the same order as the HLF_ enums!
+ * When chainging this also adjust the default for 'highlight'. */
#define HL_FLAGS {'8', '@', 'd', 'e', 'h', 'i', 'l', 'm', 'M', \
'n', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', \
'f', 'F', 'A', 'C', 'D', 'T', '>', \
'B', 'P', 'R', 'L', \
- '+', '=', 'x', 'X', '*', '#', '_'}
+ '+', '=', 'x', 'X', '*', '#', '_', '!', '.'}
/*
* Boolean constants
p_ch = Rows - cmdline_row;
if (p_ch < 1)
p_ch = 1;
- redraw_all_later(NOT_VALID);
+ redraw_all_later(SOME_VALID);
showmode();
}
wp->w_prev_fraction_row = wp->w_wrow;
win_comp_scroll(wp);
- redraw_win_later(wp, NOT_VALID);
+ redraw_win_later(wp, SOME_VALID);
#ifdef FEAT_WINDOWS
wp->w_redr_status = TRUE;
#endif
else
win_new_height(wp, wp->w_height - 1);
comp_col();
- redraw_all_later(NOT_VALID);
+ redraw_all_later(SOME_VALID);
}
}
#ifdef FEAT_VERTSPLIT