summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/buffer.c16
-rw-r--r--src/getchar.c4
-rw-r--r--src/mark.c5
-rw-r--r--src/normal.c21
-rw-r--r--src/window.c12
5 files changed, 45 insertions, 13 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 83c96903f..6d654b26a 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -4758,7 +4758,21 @@ buf_spname(buf)
{
#if defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)
if (bt_quickfix(buf))
- return _("[Error List]");
+ {
+ win_T *win;
+
+ /*
+ * For location list window, w_llist_ref points to the location list.
+ * For quickfix window, w_llist_ref is NULL.
+ */
+ FOR_ALL_WINDOWS(win)
+ if (win->w_buffer == buf)
+ break;
+ if (win != NULL && win->w_llist_ref != NULL)
+ return _("[Location List]");
+ else
+ return _("[Error List]");
+ }
#endif
#ifdef FEAT_QUICKFIX
/* There is no _file_ when 'buftype' is "nofile", b_sfname
diff --git a/src/getchar.c b/src/getchar.c
index 5da7537ff..ff821cb02 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -2365,7 +2365,7 @@ vgetorpeek(advance)
colnr_T col = 0, vcol;
char_u *ptr;
- if (p_smd && msg_silent == 0)
+ if (mode_displayed)
{
unshowmode(TRUE);
mode_deleted = TRUE;
@@ -2643,7 +2643,7 @@ vgetorpeek(advance)
*/
if (advance && p_smd && msg_silent == 0 && (State & INSERT))
{
- if (c == ESC && !mode_deleted && !no_mapping)
+ if (c == ESC && !mode_deleted && !no_mapping && mode_displayed)
{
if (typebuf.tb_len && !KeyTyped)
redraw_cmdline = TRUE; /* delete mode later */
diff --git a/src/mark.c b/src/mark.c
index d3db4a601..f077b1133 100644
--- a/src/mark.c
+++ b/src/mark.c
@@ -1004,7 +1004,10 @@ mark_adjust(line1, line2, amount, amount_after)
#ifdef FEAT_QUICKFIX
/* quickfix marks */
- qf_mark_adjust(line1, line2, amount, amount_after);
+ qf_mark_adjust(NULL, line1, line2, amount, amount_after);
+ /* location lists */
+ FOR_ALL_WINDOWS(win)
+ qf_mark_adjust(win, line1, line2, amount, amount_after);
#endif
#ifdef FEAT_SIGNS
diff --git a/src/normal.c b/src/normal.c
index 4d105e731..9e68b2b07 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -1714,7 +1714,7 @@ do_pending_operator(cap, old_col, gui_yank)
setmouse();
mouse_dragging = 0;
# endif
- if (p_smd && msg_silent == 0)
+ if (mode_displayed)
clear_cmdline = TRUE; /* unshow visual mode later */
#ifdef FEAT_CMDL_INFO
else
@@ -2779,7 +2779,10 @@ do_mouse(oap, c, dir, count, fixindent)
{
if (State & INSERT)
stuffcharReadbuff(Ctrl_O);
- stuffReadbuff((char_u *)":.cc\n");
+ if (curwin->w_llist_ref == NULL) /* quickfix window */
+ stuffReadbuff((char_u *)":.cc\n");
+ else /* location list window */
+ stuffReadbuff((char_u *)":.ll\n");
got_click = FALSE; /* ignore drag&release now */
}
#endif
@@ -2948,8 +2951,9 @@ do_mouse(oap, c, dir, count, fixindent)
}
/* If Visual mode changed show it later. */
- if (p_smd && msg_silent == 0
- && (VIsual_active != old_active || VIsual_mode != old_mode))
+ if ((!VIsual_active && old_active && mode_displayed)
+ || (VIsual_active && p_smd && msg_silent == 0
+ && (!old_active || VIsual_mode != old_mode)))
redraw_cmdline = TRUE;
#endif
@@ -3115,7 +3119,7 @@ end_visual_mode()
curwin->w_cursor.coladd = 0;
#endif
- if (p_smd && msg_silent == 0)
+ if (mode_displayed)
clear_cmdline = TRUE; /* unshow visual mode later */
#ifdef FEAT_CMDL_INFO
else
@@ -5713,7 +5717,10 @@ nv_down(cap)
#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
/* In a quickfix window a <CR> jumps to the error under the cursor. */
if (bt_quickfix(curbuf) && cap->cmdchar == CAR)
- do_cmdline_cmd((char_u *)".cc");
+ if (curwin->w_llist_ref == NULL)
+ do_cmdline_cmd((char_u *)".cc"); /* quickfix window */
+ else
+ do_cmdline_cmd((char_u *)".ll"); /* location list window */
else
#endif
{
@@ -8282,7 +8289,7 @@ nv_normal(cap)
if (cap->nchar == Ctrl_N || cap->nchar == Ctrl_G)
{
clearop(cap->oap);
- if (restart_edit != 0 && p_smd && msg_silent == 0)
+ if (restart_edit != 0 && mode_displayed)
clear_cmdline = TRUE; /* unshow mode later */
restart_edit = 0;
#ifdef FEAT_CMDWIN
diff --git a/src/window.c b/src/window.c
index bb2647cff..6bb9c4674 100644
--- a/src/window.c
+++ b/src/window.c
@@ -518,8 +518,9 @@ newwindow:
*/
if (bt_quickfix(curbuf))
{
- sprintf((char *)cbuf, "split +%ldcc",
- (long)curwin->w_cursor.lnum);
+ sprintf((char *)cbuf, "split +%ld%s",
+ (long)curwin->w_cursor.lnum,
+ (curwin->w_llist_ref == NULL) ? "cc" : "ll");
do_cmdline_cmd(cbuf);
}
#endif
@@ -817,6 +818,9 @@ win_split_ins(size, flags, newwin, dir)
#ifdef FEAT_JUMPLIST
copy_jumplist(curwin, wp);
#endif
+#ifdef FEAT_QUICKFIX
+ copy_loclist(curwin, wp);
+#endif
if (curwin->w_localdir != NULL)
wp->w_localdir = vim_strsave(curwin->w_localdir);
@@ -3182,6 +3186,10 @@ win_free(wp)
free_jumplist(wp);
#endif
+#ifdef FEAT_QUICKFIX
+ qf_free_all(wp);
+#endif
+
#ifdef FEAT_GUI
if (gui.in_use)
{