patch 8.2.3795: too many #ifdefs
Problem: Too many #ifdefs. Solution: Graduate the jumplist feature.
This commit is contained in:
@ -1038,12 +1038,10 @@ commands that start editing a new file.
|
|||||||
*CTRL-O*
|
*CTRL-O*
|
||||||
CTRL-O Go to [count] Older cursor position in jump list
|
CTRL-O Go to [count] Older cursor position in jump list
|
||||||
(not a motion command).
|
(not a motion command).
|
||||||
{not available without the |+jumplist| feature}
|
|
||||||
|
|
||||||
<Tab> or *CTRL-I* *<Tab>*
|
<Tab> or *CTRL-I* *<Tab>*
|
||||||
CTRL-I Go to [count] newer cursor position in jump list
|
CTRL-I Go to [count] newer cursor position in jump list
|
||||||
(not a motion command).
|
(not a motion command).
|
||||||
{not available without the |+jumplist| feature}
|
|
||||||
|
|
||||||
NOTE: In the GUI and in a terminal supporting
|
NOTE: In the GUI and in a terminal supporting
|
||||||
|modifyOtherKeys|, CTRL-I can be mapped separately
|
|modifyOtherKeys|, CTRL-I can be mapped separately
|
||||||
@ -1053,18 +1051,15 @@ CTRL-I Go to [count] newer cursor position in jump list
|
|||||||
|
|
||||||
*:ju* *:jumps*
|
*:ju* *:jumps*
|
||||||
:ju[mps] Print the jump list (not a motion command).
|
:ju[mps] Print the jump list (not a motion command).
|
||||||
{not available without the |+jumplist| feature}
|
|
||||||
|
|
||||||
*:cle* *:clearjumps*
|
*:cle* *:clearjumps*
|
||||||
:cle[arjumps] Clear the jump list of the current window.
|
:cle[arjumps] Clear the jump list of the current window.
|
||||||
{not available without the |+jumplist| feature}
|
|
||||||
|
|
||||||
*jumplist*
|
*jumplist*
|
||||||
Jumps are remembered in a jump list. With the CTRL-O and CTRL-I command you
|
Jumps are remembered in a jump list. With the CTRL-O and CTRL-I command you
|
||||||
can go to cursor positions before older jumps, and back again. Thus you can
|
can go to cursor positions before older jumps, and back again. Thus you can
|
||||||
move up and down the list. There is a separate jump list for each window.
|
move up and down the list. There is a separate jump list for each window.
|
||||||
The maximum number of entries is fixed at 100.
|
The maximum number of entries is fixed at 100.
|
||||||
{not available without the |+jumplist| feature}
|
|
||||||
|
|
||||||
For example, after three jump commands you have this jump list:
|
For example, after three jump commands you have this jump list:
|
||||||
|
|
||||||
@ -1141,13 +1136,11 @@ g; Go to [count] older position in change list.
|
|||||||
positions go to the oldest change.
|
positions go to the oldest change.
|
||||||
If there is no older change an error message is given.
|
If there is no older change an error message is given.
|
||||||
(not a motion command)
|
(not a motion command)
|
||||||
{not available without the |+jumplist| feature}
|
|
||||||
|
|
||||||
*g,* *E663*
|
*g,* *E663*
|
||||||
g, Go to [count] newer cursor position in change list.
|
g, Go to [count] newer cursor position in change list.
|
||||||
Just like |g;| but in the opposite direction.
|
Just like |g;| but in the opposite direction.
|
||||||
(not a motion command)
|
(not a motion command)
|
||||||
{not available without the |+jumplist| feature}
|
|
||||||
|
|
||||||
When using a count you jump as far back or forward as possible. Thus you can
|
When using a count you jump as far back or forward as possible. Thus you can
|
||||||
use "999g;" to go to the first change for which the position is still
|
use "999g;" to go to the first change for which the position is still
|
||||||
|
|||||||
@ -391,7 +391,7 @@ m *+hangul_input* Hangul input support |hangul|
|
|||||||
T *+insert_expand* |insert_expand| Insert mode completion
|
T *+insert_expand* |insert_expand| Insert mode completion
|
||||||
m *+ipv6* Support for IPv6 networking |channel|
|
m *+ipv6* Support for IPv6 networking |channel|
|
||||||
m *+job* starting and stopping jobs |job|
|
m *+job* starting and stopping jobs |job|
|
||||||
S *+jumplist* |jumplist|
|
T *+jumplist* |jumplist|; Always enabled since 8.2.3795
|
||||||
B *+keymap* |'keymap'|
|
B *+keymap* |'keymap'|
|
||||||
N *+lambda* |lambda| and |closure|
|
N *+lambda* |lambda| and |closure|
|
||||||
B *+langmap* |'langmap'|
|
B *+langmap* |'langmap'|
|
||||||
|
|||||||
@ -1416,7 +1416,6 @@ do_buffer_ext(
|
|||||||
bp = NULL; // used when no loaded buffer found
|
bp = NULL; // used when no loaded buffer found
|
||||||
if (au_new_curbuf.br_buf != NULL && bufref_valid(&au_new_curbuf))
|
if (au_new_curbuf.br_buf != NULL && bufref_valid(&au_new_curbuf))
|
||||||
buf = au_new_curbuf.br_buf;
|
buf = au_new_curbuf.br_buf;
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
else if (curwin->w_jumplistlen > 0)
|
else if (curwin->w_jumplistlen > 0)
|
||||||
{
|
{
|
||||||
int jumpidx;
|
int jumpidx;
|
||||||
@ -1452,7 +1451,6 @@ do_buffer_ext(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (buf == NULL) // No previous buffer, Try 2'nd approach
|
if (buf == NULL) // No previous buffer, Try 2'nd approach
|
||||||
{
|
{
|
||||||
|
|||||||
@ -469,11 +469,9 @@ changed_common(
|
|||||||
win_T *wp;
|
win_T *wp;
|
||||||
tabpage_T *tp;
|
tabpage_T *tp;
|
||||||
int i;
|
int i;
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
int cols;
|
int cols;
|
||||||
pos_T *p;
|
pos_T *p;
|
||||||
int add;
|
int add;
|
||||||
#endif
|
|
||||||
|
|
||||||
// mark the buffer as modified
|
// mark the buffer as modified
|
||||||
changed();
|
changed();
|
||||||
@ -492,7 +490,6 @@ changed_common(
|
|||||||
curbuf->b_last_change.lnum = lnum;
|
curbuf->b_last_change.lnum = lnum;
|
||||||
curbuf->b_last_change.col = col;
|
curbuf->b_last_change.col = col;
|
||||||
|
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
// Create a new entry if a new undo-able change was started or we
|
// Create a new entry if a new undo-able change was started or we
|
||||||
// don't have an entry yet.
|
// don't have an entry yet.
|
||||||
if (curbuf->b_new_change || curbuf->b_changelistlen == 0)
|
if (curbuf->b_new_change || curbuf->b_changelistlen == 0)
|
||||||
@ -552,7 +549,6 @@ changed_common(
|
|||||||
// The current window is always after the last change, so that "g,"
|
// The current window is always after the last change, so that "g,"
|
||||||
// takes you back to it.
|
// takes you back to it.
|
||||||
curwin->w_changelistidx = curbuf->b_changelistlen;
|
curwin->w_changelistidx = curbuf->b_changelistlen;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FOR_ALL_TAB_WINDOWS(tp, wp)
|
FOR_ALL_TAB_WINDOWS(tp, wp)
|
||||||
|
|||||||
@ -4301,12 +4301,10 @@ f_get(typval_T *argvars, typval_T *rettv)
|
|||||||
static void
|
static void
|
||||||
f_getchangelist(typval_T *argvars, typval_T *rettv)
|
f_getchangelist(typval_T *argvars, typval_T *rettv)
|
||||||
{
|
{
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
buf_T *buf;
|
buf_T *buf;
|
||||||
int i;
|
int i;
|
||||||
list_T *l;
|
list_T *l;
|
||||||
dict_T *d;
|
dict_T *d;
|
||||||
#endif
|
|
||||||
|
|
||||||
if (rettv_list_alloc(rettv) != OK)
|
if (rettv_list_alloc(rettv) != OK)
|
||||||
return;
|
return;
|
||||||
@ -4314,7 +4312,6 @@ f_getchangelist(typval_T *argvars, typval_T *rettv)
|
|||||||
if (in_vim9script() && check_for_opt_buffer_arg(argvars, 0) == FAIL)
|
if (in_vim9script() && check_for_opt_buffer_arg(argvars, 0) == FAIL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
if (argvars[0].v_type == VAR_UNKNOWN)
|
if (argvars[0].v_type == VAR_UNKNOWN)
|
||||||
buf = curbuf;
|
buf = curbuf;
|
||||||
else
|
else
|
||||||
@ -4349,7 +4346,6 @@ f_getchangelist(typval_T *argvars, typval_T *rettv)
|
|||||||
dict_add_number(d, "col", (long)buf->b_changelist[i].col);
|
dict_add_number(d, "col", (long)buf->b_changelist[i].col);
|
||||||
dict_add_number(d, "coladd", (long)buf->b_changelist[i].coladd);
|
dict_add_number(d, "coladd", (long)buf->b_changelist[i].coladd);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -4525,12 +4521,10 @@ f_getfontname(typval_T *argvars UNUSED, typval_T *rettv)
|
|||||||
static void
|
static void
|
||||||
f_getjumplist(typval_T *argvars, typval_T *rettv)
|
f_getjumplist(typval_T *argvars, typval_T *rettv)
|
||||||
{
|
{
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
win_T *wp;
|
win_T *wp;
|
||||||
int i;
|
int i;
|
||||||
list_T *l;
|
list_T *l;
|
||||||
dict_T *d;
|
dict_T *d;
|
||||||
#endif
|
|
||||||
|
|
||||||
if (rettv_list_alloc(rettv) != OK)
|
if (rettv_list_alloc(rettv) != OK)
|
||||||
return;
|
return;
|
||||||
@ -4541,7 +4535,6 @@ f_getjumplist(typval_T *argvars, typval_T *rettv)
|
|||||||
&& check_for_opt_number_arg(argvars, 1) == FAIL)))
|
&& check_for_opt_number_arg(argvars, 1) == FAIL)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
wp = find_tabwin(&argvars[0], &argvars[1], NULL);
|
wp = find_tabwin(&argvars[0], &argvars[1], NULL);
|
||||||
if (wp == NULL)
|
if (wp == NULL)
|
||||||
return;
|
return;
|
||||||
@ -4571,7 +4564,6 @@ f_getjumplist(typval_T *argvars, typval_T *rettv)
|
|||||||
if (wp->w_jumplist[i].fname != NULL)
|
if (wp->w_jumplist[i].fname != NULL)
|
||||||
dict_add_string(d, "filename", wp->w_jumplist[i].fname);
|
dict_add_string(d, "filename", wp->w_jumplist[i].fname);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -5322,13 +5314,7 @@ f_has(typval_T *argvars, typval_T *rettv)
|
|||||||
0
|
0
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
{"jumplist",
|
{"jumplist", 1},
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
1
|
|
||||||
#else
|
|
||||||
0
|
|
||||||
#endif
|
|
||||||
},
|
|
||||||
{"keymap",
|
{"keymap",
|
||||||
#ifdef FEAT_KEYMAP
|
#ifdef FEAT_KEYMAP
|
||||||
1
|
1
|
||||||
|
|||||||
@ -359,12 +359,6 @@ static void ex_folddo(exarg_T *eap);
|
|||||||
# define ex_nbstart ex_ni
|
# define ex_nbstart ex_ni
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef FEAT_JUMPLIST
|
|
||||||
# define ex_jumps ex_ni
|
|
||||||
# define ex_clearjumps ex_ni
|
|
||||||
# define ex_changes ex_ni
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef FEAT_PROFILE
|
#ifndef FEAT_PROFILE
|
||||||
# define ex_profile ex_ni
|
# define ex_profile ex_ni
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -110,6 +110,7 @@
|
|||||||
* +modify_fname modifiers for file name. E.g., "%:p:h".
|
* +modify_fname modifiers for file name. E.g., "%:p:h".
|
||||||
* +comments 'comments' option.
|
* +comments 'comments' option.
|
||||||
* +title 'title' and 'icon' options
|
* +title 'title' and 'icon' options
|
||||||
|
* +jumplist Jumplist, CTRL-O and CTRL-I commands.
|
||||||
*
|
*
|
||||||
* Obsolete:
|
* Obsolete:
|
||||||
* +tag_old_static Old style static tags: "file:tag file ..".
|
* +tag_old_static Old style static tags: "file:tag file ..".
|
||||||
@ -127,13 +128,6 @@
|
|||||||
# define MAX_MSG_HIST_LEN 20
|
# define MAX_MSG_HIST_LEN 20
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
* +jumplist Jumplist, CTRL-O and CTRL-I commands.
|
|
||||||
*/
|
|
||||||
#ifdef FEAT_SMALL
|
|
||||||
# define FEAT_JUMPLIST
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(FEAT_SMALL)
|
#if defined(FEAT_SMALL)
|
||||||
# define FEAT_CMDWIN
|
# define FEAT_CMDWIN
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
26
src/mark.c
26
src/mark.c
@ -136,10 +136,8 @@ setmark_pos(int c, pos_T *pos, int fnum)
|
|||||||
void
|
void
|
||||||
setpcmark(void)
|
setpcmark(void)
|
||||||
{
|
{
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
int i;
|
int i;
|
||||||
xfmark_T *fm;
|
xfmark_T *fm;
|
||||||
#endif
|
|
||||||
|
|
||||||
// for :global the mark is set only once
|
// for :global the mark is set only once
|
||||||
if (global_busy || listcmd_busy || (cmdmod.cmod_flags & CMOD_KEEPJUMPS))
|
if (global_busy || listcmd_busy || (cmdmod.cmod_flags & CMOD_KEEPJUMPS))
|
||||||
@ -148,7 +146,6 @@ setpcmark(void)
|
|||||||
curwin->w_prev_pcmark = curwin->w_pcmark;
|
curwin->w_prev_pcmark = curwin->w_pcmark;
|
||||||
curwin->w_pcmark = curwin->w_cursor;
|
curwin->w_pcmark = curwin->w_cursor;
|
||||||
|
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
// If jumplist is full: remove oldest entry
|
// If jumplist is full: remove oldest entry
|
||||||
if (++curwin->w_jumplistlen > JUMPLISTSIZE)
|
if (++curwin->w_jumplistlen > JUMPLISTSIZE)
|
||||||
{
|
{
|
||||||
@ -163,9 +160,8 @@ setpcmark(void)
|
|||||||
fm->fmark.mark = curwin->w_pcmark;
|
fm->fmark.mark = curwin->w_pcmark;
|
||||||
fm->fmark.fnum = curbuf->b_fnum;
|
fm->fmark.fnum = curbuf->b_fnum;
|
||||||
fm->fname = NULL;
|
fm->fname = NULL;
|
||||||
# ifdef FEAT_VIMINFO
|
#ifdef FEAT_VIMINFO
|
||||||
fm->time_set = vim_time();
|
fm->time_set = vim_time();
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,7 +181,6 @@ checkpcmark(void)
|
|||||||
curwin->w_prev_pcmark.lnum = 0; // it has been checked
|
curwin->w_prev_pcmark.lnum = 0; // it has been checked
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_JUMPLIST) || defined(PROTO)
|
|
||||||
/*
|
/*
|
||||||
* move "count" positions in the jump list (count may be negative)
|
* move "count" positions in the jump list (count may be negative)
|
||||||
*/
|
*/
|
||||||
@ -274,7 +269,6 @@ movechangelist(int count)
|
|||||||
curwin->w_changelistidx = n;
|
curwin->w_changelistidx = n;
|
||||||
return curbuf->b_changelist + n;
|
return curbuf->b_changelist + n;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find mark "c" in buffer pointed to by "buf".
|
* Find mark "c" in buffer pointed to by "buf".
|
||||||
@ -532,9 +526,7 @@ fmarks_check_names(buf_T *buf)
|
|||||||
{
|
{
|
||||||
char_u *name;
|
char_u *name;
|
||||||
int i;
|
int i;
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
win_T *wp;
|
win_T *wp;
|
||||||
#endif
|
|
||||||
|
|
||||||
if (buf->b_ffname == NULL)
|
if (buf->b_ffname == NULL)
|
||||||
return;
|
return;
|
||||||
@ -546,13 +538,11 @@ fmarks_check_names(buf_T *buf)
|
|||||||
for (i = 0; i < NMARKS + EXTRA_MARKS; ++i)
|
for (i = 0; i < NMARKS + EXTRA_MARKS; ++i)
|
||||||
fmarks_check_one(&namedfm[i], name, buf);
|
fmarks_check_one(&namedfm[i], name, buf);
|
||||||
|
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
FOR_ALL_WINDOWS(wp)
|
FOR_ALL_WINDOWS(wp)
|
||||||
{
|
{
|
||||||
for (i = 0; i < wp->w_jumplistlen; ++i)
|
for (i = 0; i < wp->w_jumplistlen; ++i)
|
||||||
fmarks_check_one(&wp->w_jumplist[i], name, buf);
|
fmarks_check_one(&wp->w_jumplist[i], name, buf);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
vim_free(name);
|
vim_free(name);
|
||||||
}
|
}
|
||||||
@ -626,9 +616,7 @@ clrallmarks(buf_T *buf)
|
|||||||
buf->b_last_cursor.coladd = 0;
|
buf->b_last_cursor.coladd = 0;
|
||||||
buf->b_last_insert.lnum = 0; // '^ mark cleared
|
buf->b_last_insert.lnum = 0; // '^ mark cleared
|
||||||
buf->b_last_change.lnum = 0; // '. mark cleared
|
buf->b_last_change.lnum = 0; // '. mark cleared
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
buf->b_changelistlen = 0;
|
buf->b_changelistlen = 0;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -867,7 +855,6 @@ ex_delmarks(exarg_T *eap)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_JUMPLIST) || defined(PROTO)
|
|
||||||
/*
|
/*
|
||||||
* print the jumplist
|
* print the jumplist
|
||||||
*/
|
*/
|
||||||
@ -965,7 +952,6 @@ ex_changes(exarg_T *eap UNUSED)
|
|||||||
if (curwin->w_changelistidx == curbuf->b_changelistlen)
|
if (curwin->w_changelistidx == curbuf->b_changelistlen)
|
||||||
msg_puts("\n>");
|
msg_puts("\n>");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#define one_adjust(add) \
|
#define one_adjust(add) \
|
||||||
{ \
|
{ \
|
||||||
@ -1071,11 +1057,9 @@ mark_adjust_internal(
|
|||||||
one_adjust(&(curbuf->b_last_cursor.lnum));
|
one_adjust(&(curbuf->b_last_cursor.lnum));
|
||||||
|
|
||||||
|
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
// list of change positions
|
// list of change positions
|
||||||
for (i = 0; i < curbuf->b_changelistlen; ++i)
|
for (i = 0; i < curbuf->b_changelistlen; ++i)
|
||||||
one_adjust_nodel(&(curbuf->b_changelist[i].lnum));
|
one_adjust_nodel(&(curbuf->b_changelist[i].lnum));
|
||||||
#endif
|
|
||||||
|
|
||||||
// Visual area
|
// Visual area
|
||||||
one_adjust_nodel(&(curbuf->b_visual.vi_start.lnum));
|
one_adjust_nodel(&(curbuf->b_visual.vi_start.lnum));
|
||||||
@ -1109,14 +1093,12 @@ mark_adjust_internal(
|
|||||||
*/
|
*/
|
||||||
FOR_ALL_TAB_WINDOWS(tab, win)
|
FOR_ALL_TAB_WINDOWS(tab, win)
|
||||||
{
|
{
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
if ((cmdmod.cmod_flags & CMOD_LOCKMARKS) == 0)
|
if ((cmdmod.cmod_flags & CMOD_LOCKMARKS) == 0)
|
||||||
// Marks in the jumplist. When deleting lines, this may create
|
// Marks in the jumplist. When deleting lines, this may create
|
||||||
// duplicate marks in the jumplist, they will be removed later.
|
// duplicate marks in the jumplist, they will be removed later.
|
||||||
for (i = 0; i < win->w_jumplistlen; ++i)
|
for (i = 0; i < win->w_jumplistlen; ++i)
|
||||||
if (win->w_jumplist[i].fmark.fnum == fnum)
|
if (win->w_jumplist[i].fmark.fnum == fnum)
|
||||||
one_adjust_nodel(&(win->w_jumplist[i].fmark.mark.lnum));
|
one_adjust_nodel(&(win->w_jumplist[i].fmark.mark.lnum));
|
||||||
#endif
|
|
||||||
|
|
||||||
if (win->w_buffer == curbuf)
|
if (win->w_buffer == curbuf)
|
||||||
{
|
{
|
||||||
@ -1249,11 +1231,9 @@ mark_col_adjust(
|
|||||||
// last change position
|
// last change position
|
||||||
col_adjust(&(curbuf->b_last_change));
|
col_adjust(&(curbuf->b_last_change));
|
||||||
|
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
// list of change positions
|
// list of change positions
|
||||||
for (i = 0; i < curbuf->b_changelistlen; ++i)
|
for (i = 0; i < curbuf->b_changelistlen; ++i)
|
||||||
col_adjust(&(curbuf->b_changelist[i]));
|
col_adjust(&(curbuf->b_changelist[i]));
|
||||||
#endif
|
|
||||||
|
|
||||||
// Visual area
|
// Visual area
|
||||||
col_adjust(&(curbuf->b_visual.vi_start));
|
col_adjust(&(curbuf->b_visual.vi_start));
|
||||||
@ -1273,12 +1253,10 @@ mark_col_adjust(
|
|||||||
*/
|
*/
|
||||||
FOR_ALL_WINDOWS(win)
|
FOR_ALL_WINDOWS(win)
|
||||||
{
|
{
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
// marks in the jumplist
|
// marks in the jumplist
|
||||||
for (i = 0; i < win->w_jumplistlen; ++i)
|
for (i = 0; i < win->w_jumplistlen; ++i)
|
||||||
if (win->w_jumplist[i].fmark.fnum == fnum)
|
if (win->w_jumplist[i].fmark.fnum == fnum)
|
||||||
col_adjust(&(win->w_jumplist[i].fmark.mark));
|
col_adjust(&(win->w_jumplist[i].fmark.mark));
|
||||||
#endif
|
|
||||||
|
|
||||||
if (win->w_buffer == curbuf)
|
if (win->w_buffer == curbuf)
|
||||||
{
|
{
|
||||||
@ -1294,7 +1272,6 @@ mark_col_adjust(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
/*
|
/*
|
||||||
* When deleting lines, this may create duplicate marks in the
|
* When deleting lines, this may create duplicate marks in the
|
||||||
* jumplist. They will be removed here for the specified window.
|
* jumplist. They will be removed here for the specified window.
|
||||||
@ -1371,7 +1348,6 @@ free_jumplist(win_T *wp)
|
|||||||
for (i = 0; i < wp->w_jumplistlen; ++i)
|
for (i = 0; i < wp->w_jumplistlen; ++i)
|
||||||
vim_free(wp->w_jumplist[i].fname);
|
vim_free(wp->w_jumplist[i].fname);
|
||||||
}
|
}
|
||||||
#endif // FEAT_JUMPLIST
|
|
||||||
|
|
||||||
void
|
void
|
||||||
set_last_cursor(win_T *win)
|
set_last_cursor(win_T *win)
|
||||||
|
|||||||
10
src/normal.c
10
src/normal.c
@ -5593,12 +5593,11 @@ nv_gomark(cmdarg_T *cap)
|
|||||||
static void
|
static void
|
||||||
nv_pcmark(cmdarg_T *cap)
|
nv_pcmark(cmdarg_T *cap)
|
||||||
{
|
{
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
pos_T *pos;
|
pos_T *pos;
|
||||||
# ifdef FEAT_FOLDING
|
#ifdef FEAT_FOLDING
|
||||||
linenr_T lnum = curwin->w_cursor.lnum;
|
linenr_T lnum = curwin->w_cursor.lnum;
|
||||||
int old_KeyTyped = KeyTyped; // getting file may reset it
|
int old_KeyTyped = KeyTyped; // getting file may reset it
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
if (!checkclearopq(cap->oap))
|
if (!checkclearopq(cap->oap))
|
||||||
{
|
{
|
||||||
@ -5638,9 +5637,6 @@ nv_pcmark(cmdarg_T *cap)
|
|||||||
foldOpenCursor();
|
foldOpenCursor();
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
clearopbeep(cap->oap);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -6444,7 +6440,6 @@ nv_g_cmd(cmdarg_T *cap)
|
|||||||
do_exmode(TRUE);
|
do_exmode(TRUE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
case ',':
|
case ',':
|
||||||
nv_pcmark(cap);
|
nv_pcmark(cap);
|
||||||
break;
|
break;
|
||||||
@ -6453,7 +6448,6 @@ nv_g_cmd(cmdarg_T *cap)
|
|||||||
cap->count1 = -cap->count1;
|
cap->count1 = -cap->count1;
|
||||||
nv_pcmark(cap);
|
nv_pcmark(cap);
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
case 't':
|
case 't':
|
||||||
if (!checkclearop(oap))
|
if (!checkclearop(oap))
|
||||||
|
|||||||
@ -2763,14 +2763,12 @@ struct file_buffer
|
|||||||
pos_T b_last_insert; // where Insert mode was left
|
pos_T b_last_insert; // where Insert mode was left
|
||||||
pos_T b_last_change; // position of last change: '. mark
|
pos_T b_last_change; // position of last change: '. mark
|
||||||
|
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
/*
|
/*
|
||||||
* the changelist contains old change positions
|
* the changelist contains old change positions
|
||||||
*/
|
*/
|
||||||
pos_T b_changelist[JUMPLISTSIZE];
|
pos_T b_changelist[JUMPLISTSIZE];
|
||||||
int b_changelistlen; // number of active entries
|
int b_changelistlen; // number of active entries
|
||||||
int b_new_change; // set by u_savecommon()
|
int b_new_change; // set by u_savecommon()
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Character table, only used in charset.c for 'iskeyword'
|
* Character table, only used in charset.c for 'iskeyword'
|
||||||
@ -3730,7 +3728,6 @@ struct window_S
|
|||||||
pos_T w_pcmark; // previous context mark
|
pos_T w_pcmark; // previous context mark
|
||||||
pos_T w_prev_pcmark; // previous w_pcmark
|
pos_T w_prev_pcmark; // previous w_pcmark
|
||||||
|
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
/*
|
/*
|
||||||
* the jumplist contains old cursor positions
|
* the jumplist contains old cursor positions
|
||||||
*/
|
*/
|
||||||
@ -3739,7 +3736,6 @@ struct window_S
|
|||||||
int w_jumplistidx; // current position
|
int w_jumplistidx; // current position
|
||||||
|
|
||||||
int w_changelistidx; // current position in b_changelist
|
int w_changelistidx; // current position in b_changelist
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef FEAT_SEARCH_EXTRA
|
#ifdef FEAT_SEARCH_EXTRA
|
||||||
matchitem_T *w_match_head; // head of match list
|
matchitem_T *w_match_head; // head of match list
|
||||||
|
|||||||
@ -1,11 +1,7 @@
|
|||||||
" Tests for the changelist functionality
|
" Tests for the changelist functionality
|
||||||
|
|
||||||
source check.vim
|
|
||||||
|
|
||||||
" Tests for the getchangelist() function
|
" Tests for the getchangelist() function
|
||||||
func Test_getchangelist()
|
func Test_getchangelist()
|
||||||
CheckFeature jumplist
|
|
||||||
|
|
||||||
bwipe!
|
bwipe!
|
||||||
enew
|
enew
|
||||||
call assert_equal([], 10->getchangelist())
|
call assert_equal([], 10->getchangelist())
|
||||||
|
|||||||
@ -1,11 +1,7 @@
|
|||||||
" Tests for the jumplist functionality
|
" Tests for the jumplist functionality
|
||||||
|
|
||||||
source check.vim
|
|
||||||
|
|
||||||
" Tests for the getjumplist() function
|
" Tests for the getjumplist() function
|
||||||
func Test_getjumplist()
|
func Test_getjumplist()
|
||||||
CheckFeature jumplist
|
|
||||||
|
|
||||||
%bwipe
|
%bwipe
|
||||||
clearjumps
|
clearjumps
|
||||||
call assert_equal([[], 0], getjumplist())
|
call assert_equal([[], 0], getjumplist())
|
||||||
|
|||||||
@ -2336,7 +2336,6 @@ endfunc
|
|||||||
" Test for g`, g;, g,, g&, gv, gk, gj, gJ, g0, g^, g_, gm, g$, gM, g CTRL-G,
|
" Test for g`, g;, g,, g&, gv, gk, gj, gJ, g0, g^, g_, gm, g$, gM, g CTRL-G,
|
||||||
" gi and gI commands
|
" gi and gI commands
|
||||||
func Test_normal33_g_cmd2()
|
func Test_normal33_g_cmd2()
|
||||||
CheckFeature jumplist
|
|
||||||
call Setup_NewWindow()
|
call Setup_NewWindow()
|
||||||
" Test for g`
|
" Test for g`
|
||||||
clearjumps
|
clearjumps
|
||||||
@ -3270,7 +3269,6 @@ endfunc
|
|||||||
|
|
||||||
" Tests for g cmds
|
" Tests for g cmds
|
||||||
func Test_normal_gdollar_cmd()
|
func Test_normal_gdollar_cmd()
|
||||||
CheckFeature jumplist
|
|
||||||
call Setup_NewWindow()
|
call Setup_NewWindow()
|
||||||
" Make long lines that will wrap
|
" Make long lines that will wrap
|
||||||
%s/$/\=repeat(' foobar', 10)/
|
%s/$/\=repeat(' foobar', 10)/
|
||||||
|
|||||||
@ -240,7 +240,7 @@ u_save_cursor(void)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Save the lines between "top" and "bot" for both the "u" and "U" command.
|
* Save the lines between "top" and "bot" for both the "u" and "U" command.
|
||||||
* "top" may be 0 and bot may be curbuf->b_ml.ml_line_count + 1.
|
* "top" may be 0 and "bot" may be curbuf->b_ml.ml_line_count + 1.
|
||||||
* Careful: may trigger autocommands that reload the buffer.
|
* Careful: may trigger autocommands that reload the buffer.
|
||||||
* Returns FAIL when lines could not be saved, OK otherwise.
|
* Returns FAIL when lines could not be saved, OK otherwise.
|
||||||
*/
|
*/
|
||||||
@ -497,10 +497,8 @@ u_savecommon(
|
|||||||
*/
|
*/
|
||||||
if (curbuf->b_u_synced)
|
if (curbuf->b_u_synced)
|
||||||
{
|
{
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
// Need to create new entry in b_changelist.
|
// Need to create new entry in b_changelist.
|
||||||
curbuf->b_new_change = TRUE;
|
curbuf->b_new_change = TRUE;
|
||||||
#endif
|
|
||||||
|
|
||||||
if (get_undolevel() >= 0)
|
if (get_undolevel() >= 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -312,11 +312,7 @@ static char *(features[]) =
|
|||||||
#else
|
#else
|
||||||
"-job",
|
"-job",
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
"+jumplist",
|
"+jumplist",
|
||||||
#else
|
|
||||||
"-jumplist",
|
|
||||||
#endif
|
|
||||||
#ifdef FEAT_KEYMAP
|
#ifdef FEAT_KEYMAP
|
||||||
"+keymap",
|
"+keymap",
|
||||||
#else
|
#else
|
||||||
@ -753,6 +749,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
3795,
|
||||||
/**/
|
/**/
|
||||||
3794,
|
3794,
|
||||||
/**/
|
/**/
|
||||||
|
|||||||
@ -1947,10 +1947,8 @@ write_viminfo_registers(FILE *fp)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static xfmark_T *vi_namedfm = NULL;
|
static xfmark_T *vi_namedfm = NULL;
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
static xfmark_T *vi_jumplist = NULL;
|
static xfmark_T *vi_jumplist = NULL;
|
||||||
static int vi_jumplist_len = 0;
|
static int vi_jumplist_len = 0;
|
||||||
#endif
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
write_one_mark(FILE *fp_out, int c, pos_T *pos)
|
write_one_mark(FILE *fp_out, int c, pos_T *pos)
|
||||||
@ -1978,7 +1976,6 @@ write_buffer_marks(buf_T *buf, FILE *fp_out)
|
|||||||
write_one_mark(fp_out, '"', &buf->b_last_cursor);
|
write_one_mark(fp_out, '"', &buf->b_last_cursor);
|
||||||
write_one_mark(fp_out, '^', &buf->b_last_insert);
|
write_one_mark(fp_out, '^', &buf->b_last_insert);
|
||||||
write_one_mark(fp_out, '.', &buf->b_last_change);
|
write_one_mark(fp_out, '.', &buf->b_last_change);
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
// changelist positions are stored oldest first
|
// changelist positions are stored oldest first
|
||||||
for (i = 0; i < buf->b_changelistlen; ++i)
|
for (i = 0; i < buf->b_changelistlen; ++i)
|
||||||
{
|
{
|
||||||
@ -1987,7 +1984,6 @@ write_buffer_marks(buf_T *buf, FILE *fp_out)
|
|||||||
buf->b_changelist[i]))
|
buf->b_changelist[i]))
|
||||||
write_one_mark(fp_out, '+', &buf->b_changelist[i]);
|
write_one_mark(fp_out, '+', &buf->b_changelist[i]);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
for (i = 0; i < NMARKS; i++)
|
for (i = 0; i < NMARKS; i++)
|
||||||
write_one_mark(fp_out, 'a' + i, &buf->b_namedm[i]);
|
write_one_mark(fp_out, 'a' + i, &buf->b_namedm[i]);
|
||||||
}
|
}
|
||||||
@ -2173,7 +2169,6 @@ write_viminfo_filemarks(FILE *fp)
|
|||||||
write_one_filemark(fp, fm, '\'', i - NMARKS + '0');
|
write_one_filemark(fp, fm, '\'', i - NMARKS + '0');
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
// Write the jumplist with -'
|
// Write the jumplist with -'
|
||||||
fputs(_("\n# Jumplist (newest first):\n"), fp);
|
fputs(_("\n# Jumplist (newest first):\n"), fp);
|
||||||
setpcmark(); // add current cursor position
|
setpcmark(); // add current cursor position
|
||||||
@ -2201,7 +2196,6 @@ write_viminfo_filemarks(FILE *fp)
|
|||||||
&& !skip_for_viminfo(buf)))
|
&& !skip_for_viminfo(buf)))
|
||||||
write_one_filemark(fp, fm, '-', '\'');
|
write_one_filemark(fp, fm, '-', '\'');
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2412,7 +2406,6 @@ copy_viminfo_marks(
|
|||||||
case '^': curbuf->b_last_insert = pos; break;
|
case '^': curbuf->b_last_insert = pos; break;
|
||||||
case '.': curbuf->b_last_change = pos; break;
|
case '.': curbuf->b_last_change = pos; break;
|
||||||
case '+':
|
case '+':
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
// changelist positions are stored oldest
|
// changelist positions are stored oldest
|
||||||
// first
|
// first
|
||||||
if (curbuf->b_changelistlen == JUMPLISTSIZE)
|
if (curbuf->b_changelistlen == JUMPLISTSIZE)
|
||||||
@ -2424,7 +2417,6 @@ copy_viminfo_marks(
|
|||||||
++curbuf->b_changelistlen;
|
++curbuf->b_changelistlen;
|
||||||
curbuf->b_changelist[
|
curbuf->b_changelist[
|
||||||
curbuf->b_changelistlen - 1] = pos;
|
curbuf->b_changelistlen - 1] = pos;
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Using the line number for the last-used
|
// Using the line number for the last-used
|
||||||
@ -2442,7 +2434,6 @@ copy_viminfo_marks(
|
|||||||
|
|
||||||
if (load_marks)
|
if (load_marks)
|
||||||
{
|
{
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
win_T *wp;
|
win_T *wp;
|
||||||
|
|
||||||
FOR_ALL_WINDOWS(wp)
|
FOR_ALL_WINDOWS(wp)
|
||||||
@ -2450,7 +2441,6 @@ copy_viminfo_marks(
|
|||||||
if (wp->w_buffer == curbuf)
|
if (wp->w_buffer == curbuf)
|
||||||
wp->w_changelistidx = curbuf->b_changelistlen;
|
wp->w_changelistidx = curbuf->b_changelistlen;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if (flags & VIF_ONLY_CURBUF)
|
if (flags & VIF_ONLY_CURBUF)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2504,7 +2494,6 @@ read_viminfo_filemark(vir_T *virp, int force)
|
|||||||
{
|
{
|
||||||
if (*str == '\'')
|
if (*str == '\'')
|
||||||
{
|
{
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
// If the jumplist isn't full insert fmark as oldest entry
|
// If the jumplist isn't full insert fmark as oldest entry
|
||||||
if (curwin->w_jumplistlen == JUMPLISTSIZE)
|
if (curwin->w_jumplistlen == JUMPLISTSIZE)
|
||||||
fm = NULL;
|
fm = NULL;
|
||||||
@ -2518,9 +2507,6 @@ read_viminfo_filemark(vir_T *virp, int force)
|
|||||||
fm->fmark.mark.lnum = 0;
|
fm->fmark.mark.lnum = 0;
|
||||||
fm->fname = NULL;
|
fm->fname = NULL;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
fm = NULL;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else if (VIM_ISDIGIT(*str))
|
else if (VIM_ISDIGIT(*str))
|
||||||
fm = &namedfm_p[*str - '0' + NMARKS];
|
fm = &namedfm_p[*str - '0' + NMARKS];
|
||||||
@ -2551,10 +2537,8 @@ read_viminfo_filemark(vir_T *virp, int force)
|
|||||||
prepare_viminfo_marks(void)
|
prepare_viminfo_marks(void)
|
||||||
{
|
{
|
||||||
vi_namedfm = ALLOC_CLEAR_MULT(xfmark_T, NMARKS + EXTRA_MARKS);
|
vi_namedfm = ALLOC_CLEAR_MULT(xfmark_T, NMARKS + EXTRA_MARKS);
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
vi_jumplist = ALLOC_CLEAR_MULT(xfmark_T, JUMPLISTSIZE);
|
vi_jumplist = ALLOC_CLEAR_MULT(xfmark_T, JUMPLISTSIZE);
|
||||||
vi_jumplist_len = 0;
|
vi_jumplist_len = 0;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -2568,14 +2552,12 @@ finish_viminfo_marks(void)
|
|||||||
vim_free(vi_namedfm[i].fname);
|
vim_free(vi_namedfm[i].fname);
|
||||||
VIM_CLEAR(vi_namedfm);
|
VIM_CLEAR(vi_namedfm);
|
||||||
}
|
}
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
if (vi_jumplist != NULL)
|
if (vi_jumplist != NULL)
|
||||||
{
|
{
|
||||||
for (i = 0; i < vi_jumplist_len; ++i)
|
for (i = 0; i < vi_jumplist_len; ++i)
|
||||||
vim_free(vi_jumplist[i].fname);
|
vim_free(vi_jumplist[i].fname);
|
||||||
VIM_CLEAR(vi_jumplist);
|
VIM_CLEAR(vi_jumplist);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2612,7 +2594,6 @@ handle_viminfo_mark(garray_T *values, int force)
|
|||||||
|
|
||||||
if (name == '\'')
|
if (name == '\'')
|
||||||
{
|
{
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
if (vi_jumplist != NULL)
|
if (vi_jumplist != NULL)
|
||||||
{
|
{
|
||||||
if (vi_jumplist_len < JUMPLISTSIZE)
|
if (vi_jumplist_len < JUMPLISTSIZE)
|
||||||
@ -2667,7 +2648,6 @@ handle_viminfo_mark(garray_T *values, int force)
|
|||||||
fm->time_set = 0;
|
fm->time_set = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1332,10 +1332,8 @@ win_split_ins(
|
|||||||
p_wh = size;
|
p_wh = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
// Keep same changelist position in new window.
|
// Keep same changelist position in new window.
|
||||||
wp->w_changelistidx = oldwin->w_changelistidx;
|
wp->w_changelistidx = oldwin->w_changelistidx;
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* make the new window the current window
|
* make the new window the current window
|
||||||
@ -1383,9 +1381,7 @@ win_init(win_T *newp, win_T *oldp, int flags UNUSED)
|
|||||||
newp->w_wrow = oldp->w_wrow;
|
newp->w_wrow = oldp->w_wrow;
|
||||||
newp->w_fraction = oldp->w_fraction;
|
newp->w_fraction = oldp->w_fraction;
|
||||||
newp->w_prev_fraction_row = oldp->w_prev_fraction_row;
|
newp->w_prev_fraction_row = oldp->w_prev_fraction_row;
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
copy_jumplist(oldp, newp);
|
copy_jumplist(oldp, newp);
|
||||||
#endif
|
|
||||||
#ifdef FEAT_QUICKFIX
|
#ifdef FEAT_QUICKFIX
|
||||||
if (flags & WSP_NEWLOC)
|
if (flags & WSP_NEWLOC)
|
||||||
{
|
{
|
||||||
@ -5161,9 +5157,7 @@ win_free(
|
|||||||
clear_matches(wp);
|
clear_matches(wp);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FEAT_JUMPLIST
|
|
||||||
free_jumplist(wp);
|
free_jumplist(wp);
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef FEAT_QUICKFIX
|
#ifdef FEAT_QUICKFIX
|
||||||
qf_free_all(wp);
|
qf_free_all(wp);
|
||||||
|
|||||||
Reference in New Issue
Block a user