mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
updated for version 7.0225
This commit is contained in:
38
src/diff.c
38
src/diff.c
@@ -21,6 +21,8 @@ static int diff_busy = FALSE; /* ex_diffgetput() is busy */
|
||||
#define DIFF_FILLER 1 /* display filler lines */
|
||||
#define DIFF_ICASE 2 /* ignore case */
|
||||
#define DIFF_IWHITE 4 /* ignore change in white space */
|
||||
#define DIFF_HORIZONTAL 8 /* horizontal splits */
|
||||
#define DIFF_VERTICAL 16 /* vertical splits */
|
||||
static int diff_flags = DIFF_FILLER;
|
||||
|
||||
#define LBUFLEN 50 /* length of line in diff file */
|
||||
@@ -977,7 +979,7 @@ ex_diffpatch(eap)
|
||||
/* don't use a new tab page, each tab page has its own diffs */
|
||||
cmdmod.tab = 0;
|
||||
|
||||
if (win_split(0, 0) != FAIL)
|
||||
if (win_split(0, (diff_flags & DIFF_VERTICAL) ? WSP_VERT : 0) != FAIL)
|
||||
{
|
||||
/* Pretend it was a ":split fname" command */
|
||||
eap->cmdidx = CMD_split;
|
||||
@@ -1037,7 +1039,7 @@ ex_diffsplit(eap)
|
||||
/* don't use a new tab page, each tab page has its own diffs */
|
||||
cmdmod.tab = 0;
|
||||
|
||||
if (win_split(0, 0) != FAIL)
|
||||
if (win_split(0, (diff_flags & DIFF_VERTICAL) ? WSP_VERT : 0) != FAIL)
|
||||
{
|
||||
/* Pretend it was a ":split fname" command */
|
||||
eap->cmdidx = CMD_split;
|
||||
@@ -1086,7 +1088,7 @@ diff_win_options(wp, addbuf)
|
||||
OPT_LOCAL|OPT_FREE, 0);
|
||||
curwin = old_curwin;
|
||||
curbuf = curwin->w_buffer;
|
||||
wp->w_p_fdc = 2;
|
||||
wp->w_p_fdc = diff_foldcolumn;
|
||||
wp->w_p_fen = TRUE;
|
||||
wp->w_p_fdl = 0;
|
||||
foldUpdateAll(wp);
|
||||
@@ -1700,6 +1702,7 @@ diffopt_changed()
|
||||
char_u *p;
|
||||
int diff_context_new = 6;
|
||||
int diff_flags_new = 0;
|
||||
int diff_foldcolumn_new = 2;
|
||||
tabpage_T *tp;
|
||||
|
||||
p = p_dip;
|
||||
@@ -1725,12 +1728,31 @@ diffopt_changed()
|
||||
p += 6;
|
||||
diff_flags_new |= DIFF_IWHITE;
|
||||
}
|
||||
else if (STRNCMP(p, "horizontal", 10) == 0)
|
||||
{
|
||||
p += 10;
|
||||
diff_flags_new |= DIFF_HORIZONTAL;
|
||||
}
|
||||
else if (STRNCMP(p, "vertical", 8) == 0)
|
||||
{
|
||||
p += 8;
|
||||
diff_flags_new |= DIFF_VERTICAL;
|
||||
}
|
||||
else if (STRNCMP(p, "foldcolumn:", 11) == 0 && VIM_ISDIGIT(p[11]))
|
||||
{
|
||||
p += 11;
|
||||
diff_foldcolumn_new = getdigits(&p);
|
||||
}
|
||||
if (*p != ',' && *p != NUL)
|
||||
return FAIL;
|
||||
if (*p == ',')
|
||||
++p;
|
||||
}
|
||||
|
||||
/* Can't have both "horizontal" and "vertical". */
|
||||
if ((diff_flags_new & DIFF_HORIZONTAL) && (diff_flags_new & DIFF_VERTICAL))
|
||||
return FAIL;
|
||||
|
||||
/* If "icase" or "iwhite" was added or removed, need to update the diff. */
|
||||
if (diff_flags != diff_flags_new)
|
||||
for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
|
||||
@@ -1738,6 +1760,7 @@ diffopt_changed()
|
||||
|
||||
diff_flags = diff_flags_new;
|
||||
diff_context = diff_context_new;
|
||||
diff_foldcolumn = diff_foldcolumn_new;
|
||||
|
||||
diff_redraw(TRUE);
|
||||
|
||||
@@ -1748,6 +1771,15 @@ diffopt_changed()
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE if 'diffopt' contains "horizontal".
|
||||
*/
|
||||
int
|
||||
diffopt_horizontal()
|
||||
{
|
||||
return (diff_flags & DIFF_HORIZONTAL) != 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Find the difference within a changed line.
|
||||
* Returns TRUE if the line was added, no other buffer has it.
|
||||
|
@@ -1,10 +1,11 @@
|
||||
extern char_u *mac_string_convert __ARGS((char_u *ptr, int len, int *lenp, int fail_on_error, int from, int to, int *unconvlenp));
|
||||
extern int macroman2enc __ARGS((char_u *ptr, long *sizep, long real_size));
|
||||
extern int enc2macroman __ARGS((char_u *from, size_t fromlen, char_u *to, int *tolenp, int maxtolen, char_u *rest, int *restlenp));
|
||||
|
||||
extern void mac_conv_init __ARGS((void));
|
||||
extern void mac_conv_cleanup __ARGS((void));
|
||||
extern char_u *mac_utf16_to_enc __ARGS((UniChar *from, size_t fromLen, size_t *actualLen));
|
||||
extern UniChar *mac_enc_to_utf16 __ARGS((char_u *from, size_t fromLen, size_t *actualLen));
|
||||
extern CFStringRef mac_enc_to_cfstring __ARGS((char_u *from, size_t fromLen));
|
||||
extern char_u *mac_precompose_path __ARGS((char_u *decompPath, size_t decompLen, size_t *precompLen));
|
||||
/* os_mac_conv.c */
|
||||
char_u *mac_string_convert __ARGS((char_u *ptr, int len, int *lenp, int fail_on_error, int from_enc, int to_enc, int *unconvlenp));
|
||||
int macroman2enc __ARGS((char_u *ptr, long *sizep, long real_size));
|
||||
int enc2macroman __ARGS((char_u *from, size_t fromlen, char_u *to, int *tolenp, int maxtolen, char_u *rest, int *restlenp));
|
||||
void mac_conv_init __ARGS((void));
|
||||
void mac_conv_cleanup __ARGS((void));
|
||||
char_u *mac_utf16_to_enc __ARGS((UniChar *from, size_t fromLen, size_t *actualLen));
|
||||
UniChar *mac_enc_to_utf16 __ARGS((char_u *from, size_t fromLen, size_t *actualLen));
|
||||
CFStringRef mac_enc_to_cfstring __ARGS((char_u *from, size_t fromLen));
|
||||
char_u *mac_precompose_path __ARGS((char_u *decompPath, size_t decompLen, size_t *precompLen));
|
||||
/* vim: set ft=c : */
|
||||
|
@@ -24,7 +24,8 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
|
||||
test38.out test39.out test40.out test41.out test42.out \
|
||||
test43.out test44.out test45.out test46.out test47.out \
|
||||
test48.out test51.out test53.out test54.out test55.out \
|
||||
test56.out test57.out test58.out test59.out test60.out
|
||||
test56.out test57.out test58.out test59.out test60.out \
|
||||
test61.out
|
||||
|
||||
.SUFFIXES: .in .out
|
||||
|
||||
|
Reference in New Issue
Block a user