mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-02 11:19:22 +02:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e80371bfbb | |||
| 43ac38d613 | |||
| abbc448bc0 | |||
| 2aa5f696b9 | |||
| 1695f99d08 | |||
| 9957a10d0f | |||
| 7a2699e868 | |||
| fffbf308dd |
@@ -1255,7 +1255,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>122</string>
|
||||
<string>123</string>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
|
||||
+11
-2
@@ -1802,6 +1802,10 @@ getcmdline(
|
||||
goto cmdline_not_changed;
|
||||
#endif
|
||||
|
||||
case K_PS:
|
||||
bracketed_paste(PASTE_CMDLINE, FALSE, NULL);
|
||||
goto cmdline_changed;
|
||||
|
||||
default:
|
||||
#ifdef UNIX
|
||||
if (c == intr_char)
|
||||
@@ -2374,8 +2378,7 @@ getexmodeline(
|
||||
if (ga_grow(&line_ga, 40) == FAIL)
|
||||
break;
|
||||
|
||||
/* Get one character at a time. Don't use inchar(), it can't handle
|
||||
* special characters. */
|
||||
/* Get one character at a time. */
|
||||
prev_char = c1;
|
||||
c1 = vgetc();
|
||||
|
||||
@@ -2390,6 +2393,12 @@ getexmodeline(
|
||||
break;
|
||||
}
|
||||
|
||||
if (c1 == K_PS)
|
||||
{
|
||||
bracketed_paste(PASTE_EX, FALSE, &line_ga);
|
||||
goto redraw;
|
||||
}
|
||||
|
||||
if (!escaped)
|
||||
{
|
||||
/* CR typed means "enter", which is NL */
|
||||
|
||||
+14
-4
@@ -274,9 +274,9 @@ readfile(
|
||||
int msg_save = msg_scroll;
|
||||
linenr_T read_no_eol_lnum = 0; /* non-zero lnum when last line of
|
||||
* last read was missing the eol */
|
||||
int try_mac = (vim_strchr(p_ffs, 'm') != NULL);
|
||||
int try_dos = (vim_strchr(p_ffs, 'd') != NULL);
|
||||
int try_unix = (vim_strchr(p_ffs, 'x') != NULL);
|
||||
int try_mac;
|
||||
int try_dos;
|
||||
int try_unix;
|
||||
int file_rewind = FALSE;
|
||||
#ifdef FEAT_MBYTE
|
||||
int can_retry;
|
||||
@@ -738,6 +738,10 @@ readfile(
|
||||
curbuf->b_op_start.lnum = ((from == 0) ? 1 : from);
|
||||
curbuf->b_op_start.col = 0;
|
||||
|
||||
try_mac = (vim_strchr(p_ffs, 'm') != NULL);
|
||||
try_dos = (vim_strchr(p_ffs, 'd') != NULL);
|
||||
try_unix = (vim_strchr(p_ffs, 'x') != NULL);
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
if (!read_buffer)
|
||||
{
|
||||
@@ -769,6 +773,11 @@ readfile(
|
||||
else
|
||||
apply_autocmds_exarg(EVENT_FILEREADPRE, sfname, sfname,
|
||||
FALSE, NULL, eap);
|
||||
/* autocommands may have changed it */
|
||||
try_mac = (vim_strchr(p_ffs, 'm') != NULL);
|
||||
try_dos = (vim_strchr(p_ffs, 'd') != NULL);
|
||||
try_unix = (vim_strchr(p_ffs, 'x') != NULL);
|
||||
|
||||
if (msg_scrolled == n)
|
||||
msg_scroll = m;
|
||||
|
||||
@@ -2242,8 +2251,9 @@ rewind_retry:
|
||||
len = (colnr_T)(ptr - line_start + 1);
|
||||
if (fileformat == EOL_DOS)
|
||||
{
|
||||
if (ptr[-1] == CAR) /* remove CR */
|
||||
if (ptr > line_start && ptr[-1] == CAR)
|
||||
{
|
||||
/* remove CR before NL */
|
||||
ptr[-1] = NUL;
|
||||
--len;
|
||||
}
|
||||
|
||||
@@ -3774,6 +3774,11 @@ do_put(
|
||||
*/
|
||||
if (y_type == MCHAR && y_size == 1)
|
||||
{
|
||||
linenr_T end = curbuf->b_visual.vi_end.lnum;
|
||||
|
||||
if (curbuf->b_visual.vi_end.lnum < curbuf->b_visual.vi_start.lnum)
|
||||
end = curbuf->b_visual.vi_start.lnum;
|
||||
|
||||
do {
|
||||
totlen = count * yanklen;
|
||||
if (totlen > 0)
|
||||
@@ -3801,7 +3806,7 @@ do_put(
|
||||
}
|
||||
if (VIsual_active)
|
||||
lnum++;
|
||||
} while (VIsual_active && lnum <= curbuf->b_visual.vi_end.lnum);
|
||||
} while (VIsual_active && lnum <= end);
|
||||
|
||||
if (VIsual_active) /* reset lnum to the last visual line */
|
||||
lnum--;
|
||||
|
||||
@@ -1256,6 +1256,7 @@ prepare_pats(pat_T *pats, int has_re)
|
||||
* TAG_REGEXP use "pat" as a regexp
|
||||
* TAG_NOIC don't always ignore case
|
||||
* TAG_KEEP_LANG keep language
|
||||
* TAG_CSCOPE use cscope results for tags
|
||||
*/
|
||||
int
|
||||
find_tags(
|
||||
@@ -1423,6 +1424,14 @@ find_tags(
|
||||
*/
|
||||
if (help_only) /* want tags from help file */
|
||||
curbuf->b_help = TRUE; /* will be restored later */
|
||||
#ifdef FEAT_CSCOPE
|
||||
else if (use_cscope)
|
||||
{
|
||||
/* Make sure we don't mix help and cscope, confuses Coverity. */
|
||||
help_only = FALSE;
|
||||
curbuf->b_help = FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
orgpat.len = (int)STRLEN(pat);
|
||||
#ifdef FEAT_MULTI_LANG
|
||||
@@ -2281,7 +2290,8 @@ parse_line:
|
||||
*/
|
||||
*tagp.tagname_end = NUL;
|
||||
len = (int)(tagp.tagname_end - tagp.tagname);
|
||||
mfp = (char_u *)alloc((int)sizeof(char_u) + len + 10 + ML_EXTRA + 1);
|
||||
mfp = (char_u *)alloc((int)sizeof(char_u)
|
||||
+ len + 10 + ML_EXTRA + 1);
|
||||
if (mfp != NULL)
|
||||
{
|
||||
int heuristic;
|
||||
|
||||
+2
-2
@@ -3154,7 +3154,7 @@ starttermcap(void)
|
||||
{
|
||||
out_str(T_TI); /* start termcap mode */
|
||||
out_str(T_KS); /* start "keypad transmit" mode */
|
||||
out_str(T_BE); /* enable bracketed paste moe */
|
||||
out_str(T_BE); /* enable bracketed paste mode */
|
||||
out_flush();
|
||||
termcap_active = TRUE;
|
||||
screen_start(); /* don't know where cursor is now */
|
||||
@@ -3204,7 +3204,7 @@ stoptermcap(void)
|
||||
check_for_codes_from_term();
|
||||
}
|
||||
#endif
|
||||
out_str(T_BD); /* disable bracketed paste moe */
|
||||
out_str(T_BD); /* disable bracketed paste mode */
|
||||
out_str(T_KE); /* stop "keypad transmit" mode */
|
||||
out_flush();
|
||||
termcap_active = FALSE;
|
||||
|
||||
@@ -15,3 +15,19 @@ func Test_fileformat_after_bw()
|
||||
call assert_equal(test_fileformats, &fileformat)
|
||||
set fileformats&
|
||||
endfunc
|
||||
|
||||
func Test_fileformat_autocommand()
|
||||
let filecnt = ["", "foobar\<CR>", "eins\<CR>", "\<CR>", "zwei\<CR>", "drei", "vier", "fünf", ""]
|
||||
let ffs = &ffs
|
||||
call writefile(filecnt, 'Xfile', 'b')
|
||||
au BufReadPre Xfile set ffs=dos ff=dos
|
||||
new Xfile
|
||||
call assert_equal('dos', &l:ff)
|
||||
call assert_equal('dos', &ffs)
|
||||
|
||||
" cleanup
|
||||
call delete('Xfile')
|
||||
let &ffs = ffs
|
||||
au! BufReadPre Xfile
|
||||
bw!
|
||||
endfunc
|
||||
|
||||
@@ -10,3 +10,14 @@ func Test_put_block()
|
||||
call assert_equal("\u2500x", getline(1))
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_put_char_block()
|
||||
new
|
||||
call setline(1, ['Line 1', 'Line 2'])
|
||||
f Xfile_put
|
||||
" visually select both lines and put the cursor at the top of the visual
|
||||
" selection and then put the buffer name over it
|
||||
exe "norm! G0\<c-v>ke\"%p"
|
||||
call assert_equal(['Xfile_put 1', 'Xfile_put 2'], getline(1,2))
|
||||
bw!
|
||||
endfunc
|
||||
|
||||
@@ -779,6 +779,18 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
228,
|
||||
/**/
|
||||
227,
|
||||
/**/
|
||||
226,
|
||||
/**/
|
||||
225,
|
||||
/**/
|
||||
224,
|
||||
/**/
|
||||
223,
|
||||
/**/
|
||||
222,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user