forked from aniani/vim
Fixed: after ":ownsyntax perl" and ":e" syntax was cleared in other window.
This commit is contained in:
parent
1950c3529b
commit
fd29f4628e
@ -1085,9 +1085,14 @@ restored. (Luc St-Louis)
|
|||||||
|
|
||||||
Vim 7.3:
|
Vim 7.3:
|
||||||
- Included conceal patch.
|
- Included conceal patch.
|
||||||
remove w:ownsyntax, automatically set w:current_syntax to the value of
|
HL disappears in other window:
|
||||||
b:current_syntax after loading a syntax file.
|
:sp
|
||||||
:ownsyntax only sets w:current_syntax.
|
:ownsyntax perl
|
||||||
|
:e
|
||||||
|
Documentation update:
|
||||||
|
remove w:ownsyntax, automatically set w:current_syntax to the value of
|
||||||
|
b:current_syntax after loading a syntax file. :ownsyntax only sets
|
||||||
|
w:current_syntax.
|
||||||
- using NSIS 2.46: install on Windows 7 works, but no "Edit with Vim" menu.
|
- using NSIS 2.46: install on Windows 7 works, but no "Edit with Vim" menu.
|
||||||
Use register_shell_extension()? (George Reilly, 2010 May 26)
|
Use register_shell_extension()? (George Reilly, 2010 May 26)
|
||||||
Ron's version: http://dev.ronware.org/p/vim/finfo?name=gvim.nsi
|
Ron's version: http://dev.ronware.org/p/vim/finfo?name=gvim.nsi
|
||||||
|
@ -1379,12 +1379,7 @@ enter_buffer(buf)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FEAT_SYN_HL
|
#ifdef FEAT_SYN_HL
|
||||||
if (curwin->w_s != &curwin->w_buffer->b_s)
|
reset_synblock(curwin);
|
||||||
{
|
|
||||||
/* Get rid of independant syntax */
|
|
||||||
syntax_clear(curwin->w_s);
|
|
||||||
vim_free(curwin->w_s);
|
|
||||||
}
|
|
||||||
curwin->w_s = &(buf->b_s);
|
curwin->w_s = &(buf->b_s);
|
||||||
#endif
|
#endif
|
||||||
/* Get the buffer in the current window. */
|
/* Get the buffer in the current window. */
|
||||||
|
@ -3571,6 +3571,9 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags, oldwin)
|
|||||||
new_name = NULL;
|
new_name = NULL;
|
||||||
#endif
|
#endif
|
||||||
buf_freeall(curbuf, FALSE, FALSE); /* free all things for buffer */
|
buf_freeall(curbuf, FALSE, FALSE); /* free all things for buffer */
|
||||||
|
#ifdef FEAT_SYN_HL
|
||||||
|
reset_synblock(curwin); /* remove any ownsyntax */
|
||||||
|
#endif
|
||||||
#ifdef FEAT_AUTOCMD
|
#ifdef FEAT_AUTOCMD
|
||||||
/* If autocommands deleted the buffer we were going to re-edit, give
|
/* If autocommands deleted the buffer we were going to re-edit, give
|
||||||
* up and jump to the end. */
|
* up and jump to the end. */
|
||||||
|
@ -6,6 +6,7 @@ void syntax_end_parsing __ARGS((linenr_T lnum));
|
|||||||
int syntax_check_changed __ARGS((linenr_T lnum));
|
int syntax_check_changed __ARGS((linenr_T lnum));
|
||||||
int get_syntax_attr __ARGS((colnr_T col, int *p_flags, int *can_spell, int keep_state));
|
int get_syntax_attr __ARGS((colnr_T col, int *p_flags, int *can_spell, int keep_state));
|
||||||
void syntax_clear __ARGS((synblock_T *block));
|
void syntax_clear __ARGS((synblock_T *block));
|
||||||
|
void reset_synblock __ARGS((win_T *wp));
|
||||||
void ex_syntax __ARGS((exarg_T *eap));
|
void ex_syntax __ARGS((exarg_T *eap));
|
||||||
void ex_ownsyntax __ARGS((exarg_T *eap));
|
void ex_ownsyntax __ARGS((exarg_T *eap));
|
||||||
int syntax_present __ARGS((win_T *win));
|
int syntax_present __ARGS((win_T *win));
|
||||||
|
16
src/syntax.c
16
src/syntax.c
@ -3420,6 +3420,21 @@ syntax_clear(block)
|
|||||||
invalidate_current_state();
|
invalidate_current_state();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get rid of ownsyntax for window "wp".
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
reset_synblock(wp)
|
||||||
|
win_T *wp;
|
||||||
|
{
|
||||||
|
if (wp->w_s != &wp->w_buffer->b_s)
|
||||||
|
{
|
||||||
|
syntax_clear(wp->w_s);
|
||||||
|
vim_free(wp->w_s);
|
||||||
|
wp->w_s = &wp->w_buffer->b_s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Clear syncing info for one buffer.
|
* Clear syncing info for one buffer.
|
||||||
*/
|
*/
|
||||||
@ -3538,7 +3553,6 @@ syn_cmd_clear(eap, syncing)
|
|||||||
if (curwin->w_s == &curwin->w_buffer->b_s)
|
if (curwin->w_s == &curwin->w_buffer->b_s)
|
||||||
do_unlet((char_u *)"b:current_syntax", TRUE);
|
do_unlet((char_u *)"b:current_syntax", TRUE);
|
||||||
do_unlet((char_u *)"w:current_syntax", TRUE);
|
do_unlet((char_u *)"w:current_syntax", TRUE);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
12
src/window.c
12
src/window.c
@ -1176,7 +1176,8 @@ win_init(newp, oldp, flags)
|
|||||||
|
|
||||||
newp->w_buffer = oldp->w_buffer;
|
newp->w_buffer = oldp->w_buffer;
|
||||||
#ifdef FEAT_SYN_HL
|
#ifdef FEAT_SYN_HL
|
||||||
newp->w_s = oldp->w_s;
|
/* TODO: use reference count? */
|
||||||
|
newp->w_s = &(oldp->w_buffer->b_s);
|
||||||
#endif
|
#endif
|
||||||
oldp->w_buffer->b_nwindows++;
|
oldp->w_buffer->b_nwindows++;
|
||||||
newp->w_cursor = oldp->w_cursor;
|
newp->w_cursor = oldp->w_cursor;
|
||||||
@ -4408,18 +4409,13 @@ win_free(wp, tp)
|
|||||||
#endif /* FEAT_GUI */
|
#endif /* FEAT_GUI */
|
||||||
|
|
||||||
#ifdef FEAT_SYN_HL
|
#ifdef FEAT_SYN_HL
|
||||||
/* free independent synblock */
|
reset_synblock(wp); /* free independent synblock */
|
||||||
if (wp->w_s != &wp->w_buffer->b_s)
|
|
||||||
{
|
|
||||||
syntax_clear(wp->w_s);
|
|
||||||
vim_free(wp->w_s);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FEAT_AUTOCMD
|
#ifdef FEAT_AUTOCMD
|
||||||
if (wp != aucmd_win)
|
if (wp != aucmd_win)
|
||||||
#endif
|
#endif
|
||||||
win_remove(wp, tp);
|
win_remove(wp, tp);
|
||||||
vim_free(wp);
|
vim_free(wp);
|
||||||
|
|
||||||
#ifdef FEAT_AUTOCMD
|
#ifdef FEAT_AUTOCMD
|
||||||
|
Loading…
x
Reference in New Issue
Block a user