mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-02 11:19:22 +02:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4cefe0c276 | |||
| 97ed4ba2f8 | |||
| ba47b51ff8 | |||
| 6a717f17ec | |||
| b031c4ea04 | |||
| 941c12da3c | |||
| bff6ad1331 | |||
| 48c9f3b123 | |||
| 076e502199 | |||
| 915350edec | |||
| 24a2d416ec |
@@ -1255,7 +1255,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>123</string>
|
||||
<string>124</string>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
|
||||
+2
-1
@@ -2164,6 +2164,7 @@ test_arglist \
|
||||
test_options \
|
||||
test_packadd \
|
||||
test_partial \
|
||||
test_paste \
|
||||
test_perl \
|
||||
test_popup \
|
||||
test_profile \
|
||||
@@ -2178,9 +2179,9 @@ test_arglist \
|
||||
test_searchpos \
|
||||
test_set \
|
||||
test_signs \
|
||||
test_smartindent \
|
||||
test_sort \
|
||||
test_source_utf8 \
|
||||
test_smartindent \
|
||||
test_startup \
|
||||
test_startup_utf8 \
|
||||
test_stat \
|
||||
|
||||
@@ -2157,6 +2157,7 @@ free_buf_options(
|
||||
#if defined(FEAT_CRYPT)
|
||||
clear_string_option(&buf->b_p_cm);
|
||||
#endif
|
||||
clear_string_option(&buf->b_p_fp);
|
||||
#if defined(FEAT_EVAL)
|
||||
clear_string_option(&buf->b_p_fex);
|
||||
#endif
|
||||
|
||||
+19
-3
@@ -463,7 +463,10 @@ edit(
|
||||
else
|
||||
#endif
|
||||
{
|
||||
AppendCharToRedobuff(cmdchar);
|
||||
if (cmdchar == K_PS)
|
||||
AppendCharToRedobuff('a');
|
||||
else
|
||||
AppendCharToRedobuff(cmdchar);
|
||||
if (cmdchar == 'g') /* "gI" command */
|
||||
AppendCharToRedobuff('I');
|
||||
else if (cmdchar == 'r') /* "r<CR>" command */
|
||||
@@ -531,6 +534,10 @@ edit(
|
||||
revins_legal = 0;
|
||||
revins_scol = -1;
|
||||
#endif
|
||||
if (!p_ek)
|
||||
/* Disable bracketed paste mode, we won't recognize the escape
|
||||
* sequences. */
|
||||
out_str(T_BD);
|
||||
|
||||
/*
|
||||
* Handle restarting Insert mode.
|
||||
@@ -8634,6 +8641,9 @@ ins_esc(
|
||||
#ifdef CURSOR_SHAPE
|
||||
ui_cursor_shape(); /* may show different cursor shape */
|
||||
#endif
|
||||
if (!p_ek)
|
||||
/* Re-enable bracketed paste mode. */
|
||||
out_str(T_BE);
|
||||
|
||||
/*
|
||||
* When recording or for CTRL-O, need to display the new mode.
|
||||
@@ -9531,8 +9541,14 @@ bracketed_paste(paste_mode_T mode, int drop, garray_T *gap)
|
||||
case PASTE_INSERT:
|
||||
if (stop_arrow() == OK)
|
||||
{
|
||||
ins_char_bytes(buf, idx);
|
||||
AppendToRedobuffLit(buf, idx);
|
||||
c = buf[0];
|
||||
if (idx == 1 && (c == CAR || c == K_KENTER || c == NL))
|
||||
ins_eol(c);
|
||||
else
|
||||
{
|
||||
ins_char_bytes(buf, idx);
|
||||
AppendToRedobuffLit(buf, idx);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
+3
-1
@@ -4377,7 +4377,9 @@ addstar(
|
||||
|| context == EXPAND_OWNSYNTAX
|
||||
|| context == EXPAND_FILETYPE
|
||||
|| context == EXPAND_PACKADD
|
||||
|| (context == EXPAND_TAGS && fname[0] == '/'))
|
||||
|| ((context == EXPAND_TAGS_LISTFILES
|
||||
|| context == EXPAND_TAGS)
|
||||
&& fname[0] == '/'))
|
||||
retval = vim_strnsave(fname, len);
|
||||
else
|
||||
{
|
||||
|
||||
@@ -3774,16 +3774,25 @@ do_put(
|
||||
*/
|
||||
if (y_type == MCHAR && y_size == 1)
|
||||
{
|
||||
linenr_T end = curbuf->b_visual.vi_end.lnum;
|
||||
linenr_T end_lnum = 0; /* init for gcc */
|
||||
|
||||
if (curbuf->b_visual.vi_end.lnum < curbuf->b_visual.vi_start.lnum)
|
||||
end = curbuf->b_visual.vi_start.lnum;
|
||||
if (VIsual_active)
|
||||
{
|
||||
end_lnum = curbuf->b_visual.vi_end.lnum;
|
||||
if (end_lnum < curbuf->b_visual.vi_start.lnum)
|
||||
end_lnum = curbuf->b_visual.vi_start.lnum;
|
||||
}
|
||||
|
||||
do {
|
||||
totlen = count * yanklen;
|
||||
if (totlen > 0)
|
||||
{
|
||||
oldp = ml_get(lnum);
|
||||
if (VIsual_active && col > (int)STRLEN(oldp))
|
||||
{
|
||||
lnum++;
|
||||
continue;
|
||||
}
|
||||
newp = alloc_check((unsigned)(STRLEN(oldp) + totlen + 1));
|
||||
if (newp == NULL)
|
||||
goto end; /* alloc() gave an error message */
|
||||
@@ -3806,7 +3815,7 @@ do_put(
|
||||
}
|
||||
if (VIsual_active)
|
||||
lnum++;
|
||||
} while (VIsual_active && lnum <= end);
|
||||
} while (VIsual_active && lnum <= end_lnum);
|
||||
|
||||
if (VIsual_active) /* reset lnum to the last visual line */
|
||||
lnum--;
|
||||
|
||||
@@ -3651,6 +3651,7 @@ win_line(
|
||||
{
|
||||
/* Draw the 'foldcolumn'. Allocate a buffer, "extra" may
|
||||
* already be in use. */
|
||||
vim_free(p_extra_free);
|
||||
p_extra_free = alloc(12 + 1);
|
||||
|
||||
if (p_extra_free != NULL)
|
||||
@@ -4695,6 +4696,7 @@ win_line(
|
||||
p = alloc((unsigned)(len + 1));
|
||||
vim_memset(p, ' ', len);
|
||||
p[len] = NUL;
|
||||
vim_free(p_extra_free);
|
||||
p_extra_free = p;
|
||||
for (i = 0; i < tab_len; i++)
|
||||
{
|
||||
@@ -4857,6 +4859,7 @@ win_line(
|
||||
vim_memset(p, ' ', n_extra);
|
||||
STRNCPY(p, p_extra + 1, STRLEN(p_extra) - 1);
|
||||
p[n_extra] = NUL;
|
||||
vim_free(p_extra_free);
|
||||
p_extra_free = p_extra = p;
|
||||
}
|
||||
else
|
||||
@@ -5789,6 +5792,7 @@ win_line(
|
||||
}
|
||||
#endif
|
||||
|
||||
vim_free(p_extra_free);
|
||||
return row;
|
||||
}
|
||||
|
||||
|
||||
@@ -173,6 +173,7 @@ NEW_TESTS = test_arglist.res \
|
||||
test_nested_function.res \
|
||||
test_netbeans.res \
|
||||
test_normal.res \
|
||||
test_paste.res \
|
||||
test_packadd.res \
|
||||
test_perl.res \
|
||||
test_profile.res \
|
||||
|
||||
@@ -295,3 +295,14 @@ func Test_illegal_address()
|
||||
2;')
|
||||
quit
|
||||
endfunc
|
||||
|
||||
func Test_cmdline_complete_wildoptions()
|
||||
help
|
||||
call feedkeys(":tag /\<c-a>\<c-b>\"\<cr>", 'tx')
|
||||
let a = join(sort(split(@:)),' ')
|
||||
set wildoptions=tagfile
|
||||
call feedkeys(":tag /\<c-a>\<c-b>\"\<cr>", 'tx')
|
||||
let b = join(sort(split(@:)),' ')
|
||||
call assert_equal(a, b)
|
||||
bw!
|
||||
endfunc
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
" Tests for bracketed paste.
|
||||
|
||||
" Bracketed paste only works with "xterm". Not in GUI.
|
||||
if has('gui_running')
|
||||
finish
|
||||
endif
|
||||
set term=xterm
|
||||
|
||||
func Test_paste_normal_mode()
|
||||
new
|
||||
call setline(1, ['a', 'b', 'c'])
|
||||
2
|
||||
call feedkeys("\<Esc>[200~foo\<CR>bar\<Esc>[201~", 'xt')
|
||||
call assert_equal('bfoo', getline(2))
|
||||
call assert_equal('bar', getline(3))
|
||||
call assert_equal('c', getline(4))
|
||||
|
||||
normal .
|
||||
call assert_equal('barfoo', getline(3))
|
||||
call assert_equal('bar', getline(4))
|
||||
call assert_equal('c', getline(5))
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_paste_insert_mode()
|
||||
new
|
||||
call setline(1, ['a', 'b', 'c'])
|
||||
2
|
||||
call feedkeys("i\<Esc>[200~foo\<CR>bar\<Esc>[201~ done\<Esc>", 'xt')
|
||||
call assert_equal('foo', getline(2))
|
||||
call assert_equal('bar doneb', getline(3))
|
||||
call assert_equal('c', getline(4))
|
||||
|
||||
normal .
|
||||
call assert_equal('bar donfoo', getline(3))
|
||||
call assert_equal('bar doneeb', getline(4))
|
||||
call assert_equal('c', getline(5))
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_paste_cmdline()
|
||||
call feedkeys(":a\<Esc>[200~foo\<CR>bar\<Esc>[201~b\<Home>\"\<CR>", 'xt')
|
||||
call assert_equal("\"afoo\<CR>barb", getreg(':'))
|
||||
endfunc
|
||||
@@ -21,3 +21,16 @@ func Test_put_char_block()
|
||||
call assert_equal(['Xfile_put 1', 'Xfile_put 2'], getline(1,2))
|
||||
bw!
|
||||
endfunc
|
||||
|
||||
func Test_put_char_block2()
|
||||
new
|
||||
let a = [ getreg('a'), getregtype('a') ]
|
||||
call setreg('a', ' one ', 'v')
|
||||
call setline(1, ['Line 1', '', 'Line 3', ''])
|
||||
" visually select the first 3 lines and put register a over it
|
||||
exe "norm! ggl\<c-v>2j2l\"ap"
|
||||
call assert_equal(['L one 1', '', 'L one 3', ''], getline(1,4))
|
||||
" clean up
|
||||
bw!
|
||||
call setreg('a', a[0], a[1])
|
||||
endfunc
|
||||
|
||||
@@ -779,6 +779,24 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
237,
|
||||
/**/
|
||||
236,
|
||||
/**/
|
||||
235,
|
||||
/**/
|
||||
234,
|
||||
/**/
|
||||
233,
|
||||
/**/
|
||||
232,
|
||||
/**/
|
||||
231,
|
||||
/**/
|
||||
230,
|
||||
/**/
|
||||
229,
|
||||
/**/
|
||||
228,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user