mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
9a5d309b57
@ -3162,8 +3162,8 @@ nobackup:
|
|||||||
#ifdef UNIX
|
#ifdef UNIX
|
||||||
FileInfo file_info;
|
FileInfo file_info;
|
||||||
|
|
||||||
/* Don't delete the file when it's a hard or symbolic link. */
|
// Don't delete the file when it's a hard or symbolic link.
|
||||||
if ((!newfile && os_fileinfo_hardlinks(&file_info) > 1)
|
if ((!newfile && os_fileinfo_hardlinks(&file_info_old) > 1)
|
||||||
|| (os_fileinfo_link((char *)fname, &file_info)
|
|| (os_fileinfo_link((char *)fname, &file_info)
|
||||||
&& !os_fileinfo_id_equal(&file_info, &file_info_old))) {
|
&& !os_fileinfo_id_equal(&file_info, &file_info_old))) {
|
||||||
SET_ERRMSG(_("E166: Can't open linked file for writing"));
|
SET_ERRMSG(_("E166: Can't open linked file for writing"));
|
||||||
@ -4547,6 +4547,7 @@ int put_time(FILE *fd, time_t time_)
|
|||||||
///
|
///
|
||||||
/// @return -1 for failure, 0 for success
|
/// @return -1 for failure, 0 for success
|
||||||
int vim_rename(const char_u *from, const char_u *to)
|
int vim_rename(const char_u *from, const char_u *to)
|
||||||
|
FUNC_ATTR_NONNULL_ALL
|
||||||
{
|
{
|
||||||
int fd_in;
|
int fd_in;
|
||||||
int fd_out;
|
int fd_out;
|
||||||
@ -4822,6 +4823,7 @@ buf_check_timestamp (
|
|||||||
buf_T *buf,
|
buf_T *buf,
|
||||||
int focus /* called for GUI focus event */
|
int focus /* called for GUI focus event */
|
||||||
)
|
)
|
||||||
|
FUNC_ATTR_NONNULL_ALL
|
||||||
{
|
{
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
char_u *path;
|
char_u *path;
|
||||||
|
@ -131,6 +131,7 @@ bool os_isdir(const char_u *name)
|
|||||||
/// NODE_WRITABLE: writable device, socket, fifo, etc.
|
/// NODE_WRITABLE: writable device, socket, fifo, etc.
|
||||||
/// NODE_OTHER: non-writable things
|
/// NODE_OTHER: non-writable things
|
||||||
int os_nodetype(const char *name)
|
int os_nodetype(const char *name)
|
||||||
|
FUNC_ATTR_NONNULL_ALL
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
// Edge case from Vim os_win32.c:
|
// Edge case from Vim os_win32.c:
|
||||||
|
@ -3,10 +3,12 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
NVIM_PRG ?= ../../../build/bin/nvim
|
NVIM_PRG ?= ../../../build/bin/nvim
|
||||||
|
TMPDIR ?= Xtest-tmpdir
|
||||||
SCRIPTSOURCE := ../../../runtime
|
SCRIPTSOURCE := ../../../runtime
|
||||||
|
|
||||||
export SHELL := sh
|
export SHELL := sh
|
||||||
export NVIM_PRG := $(NVIM_PRG)
|
export NVIM_PRG := $(NVIM_PRG)
|
||||||
|
export TMPDIR
|
||||||
|
|
||||||
SCRIPTS ?= \
|
SCRIPTS ?= \
|
||||||
test13.out \
|
test13.out \
|
||||||
@ -149,10 +151,12 @@ clean:
|
|||||||
.*.swp \
|
.*.swp \
|
||||||
.*.swo \
|
.*.swo \
|
||||||
.gdbinit \
|
.gdbinit \
|
||||||
|
$(TMPDIR) \
|
||||||
del
|
del
|
||||||
|
|
||||||
test1.out: .gdbinit test1.in
|
test1.out: .gdbinit test1.in
|
||||||
-rm -rf $*.failed $(RM_ON_RUN) $(RM_ON_START) wrongtermsize
|
-rm -rf $*.failed $(RM_ON_RUN) $(RM_ON_START) wrongtermsize
|
||||||
|
mkdir -p $(TMPDIR)
|
||||||
$(RUN_VIM) $*.in
|
$(RUN_VIM) $*.in
|
||||||
@/bin/sh -c "if test -e wrongtermsize; then \
|
@/bin/sh -c "if test -e wrongtermsize; then \
|
||||||
echo; \
|
echo; \
|
||||||
@ -170,6 +174,7 @@ test1.out: .gdbinit test1.in
|
|||||||
|
|
||||||
%.out: %.in .gdbinit
|
%.out: %.in .gdbinit
|
||||||
-rm -rf $*.failed test.ok $(RM_ON_RUN)
|
-rm -rf $*.failed test.ok $(RM_ON_RUN)
|
||||||
|
mkdir -p $(TMPDIR)
|
||||||
cp $*.ok test.ok
|
cp $*.ok test.ok
|
||||||
# Sleep a moment to avoid that the xterm title is messed up.
|
# Sleep a moment to avoid that the xterm title is messed up.
|
||||||
# 200 msec is sufficient, but only modern sleep supports a fraction of
|
# 200 msec is sufficient, but only modern sleep supports a fraction of
|
||||||
@ -212,4 +217,5 @@ newtests: newtestssilent
|
|||||||
newtestssilent: $(NEW_TESTS)
|
newtestssilent: $(NEW_TESTS)
|
||||||
|
|
||||||
%.res: %.vim .gdbinit
|
%.res: %.vim .gdbinit
|
||||||
|
mkdir -p $(TMPDIR)
|
||||||
$(RUN_VIMTEST) -u NONE -S runtest.vim $*.vim
|
$(RUN_VIMTEST) -u NONE -S runtest.vim $*.vim
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
func Test_complete_tab()
|
func Test_complete_tab()
|
||||||
call writefile(['testfile'], 'Xtestfile')
|
call writefile(['testfile'], 'Xtestfile')
|
||||||
call feedkeys(":e Xtest\t\r", "tx")
|
call feedkeys(":e Xtestf\t\r", "tx")
|
||||||
call assert_equal('testfile', getline(1))
|
call assert_equal('testfile', getline(1))
|
||||||
call delete('Xtestfile')
|
call delete('Xtestfile')
|
||||||
endfunc
|
endfunc
|
||||||
@ -17,7 +17,7 @@ func Test_complete_wildmenu()
|
|||||||
call writefile(['testfile1'], 'Xtestfile1')
|
call writefile(['testfile1'], 'Xtestfile1')
|
||||||
call writefile(['testfile2'], 'Xtestfile2')
|
call writefile(['testfile2'], 'Xtestfile2')
|
||||||
set wildmenu
|
set wildmenu
|
||||||
call feedkeys(":e Xtest\t\t\r", "tx")
|
call feedkeys(":e Xtestf\t\t\r", "tx")
|
||||||
call assert_equal('testfile2', getline(1))
|
call assert_equal('testfile2', getline(1))
|
||||||
|
|
||||||
call delete('Xtestfile1')
|
call delete('Xtestfile1')
|
||||||
|
@ -237,3 +237,31 @@ func Test_insert_expr()
|
|||||||
|
|
||||||
close!
|
close!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_undofile_earlier()
|
||||||
|
throw 'skipped: Nvim does not support test_settime()'
|
||||||
|
|
||||||
|
let t0 = localtime() - 43200
|
||||||
|
call test_settime(t0)
|
||||||
|
new Xfile
|
||||||
|
call feedkeys("ione\<Esc>", 'xt')
|
||||||
|
set ul=100
|
||||||
|
call test_settime(t0 + 1)
|
||||||
|
call feedkeys("otwo\<Esc>", 'xt')
|
||||||
|
set ul=100
|
||||||
|
call test_settime(t0 + 2)
|
||||||
|
call feedkeys("othree\<Esc>", 'xt')
|
||||||
|
set ul=100
|
||||||
|
w
|
||||||
|
wundo Xundofile
|
||||||
|
bwipe!
|
||||||
|
" restore normal timestamps.
|
||||||
|
call test_settime(0)
|
||||||
|
new Xfile
|
||||||
|
rundo Xundofile
|
||||||
|
earlier 1d
|
||||||
|
call assert_equal('', getline(1))
|
||||||
|
bwipe!
|
||||||
|
call delete('Xfile')
|
||||||
|
call delete('Xundofile')
|
||||||
|
endfunc
|
||||||
|
@ -1838,11 +1838,9 @@ void undo_time(long step, int sec, int file, int absolute)
|
|||||||
}
|
}
|
||||||
closest = -1;
|
closest = -1;
|
||||||
} else {
|
} else {
|
||||||
/* When doing computations with time_t subtract starttime, because
|
if (dosec) {
|
||||||
* time_t converted to a long may result in a wrong number. */
|
target = (long)(curbuf->b_u_time_cur) + step;
|
||||||
if (dosec)
|
} else if (dofile) {
|
||||||
target = (long)(curbuf->b_u_time_cur - starttime) + step;
|
|
||||||
else if (dofile) {
|
|
||||||
if (step < 0) {
|
if (step < 0) {
|
||||||
/* Going back to a previous write. If there were changes after
|
/* Going back to a previous write. If there were changes after
|
||||||
* the last write, count that as moving one file-write, so
|
* the last write, count that as moving one file-write, so
|
||||||
@ -1880,14 +1878,16 @@ void undo_time(long step, int sec, int file, int absolute)
|
|||||||
target = 0;
|
target = 0;
|
||||||
closest = -1;
|
closest = -1;
|
||||||
} else {
|
} else {
|
||||||
if (dosec)
|
if (dosec) {
|
||||||
closest = (long)(time(NULL) - starttime + 1);
|
closest = (long)(os_time() + 1);
|
||||||
else if (dofile)
|
} else if (dofile) {
|
||||||
closest = curbuf->b_u_save_nr_last + 2;
|
closest = curbuf->b_u_save_nr_last + 2;
|
||||||
else
|
} else {
|
||||||
closest = curbuf->b_u_seq_last + 2;
|
closest = curbuf->b_u_seq_last + 2;
|
||||||
if (target >= closest)
|
}
|
||||||
|
if (target >= closest) {
|
||||||
target = closest - 1;
|
target = closest - 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
closest_start = closest;
|
closest_start = closest;
|
||||||
@ -1916,12 +1916,13 @@ void undo_time(long step, int sec, int file, int absolute)
|
|||||||
|
|
||||||
while (uhp != NULL) {
|
while (uhp != NULL) {
|
||||||
uhp->uh_walk = mark;
|
uhp->uh_walk = mark;
|
||||||
if (dosec)
|
if (dosec) {
|
||||||
val = (long)(uhp->uh_time - starttime);
|
val = (long)(uhp->uh_time);
|
||||||
else if (dofile)
|
} else if (dofile) {
|
||||||
val = uhp->uh_save_nr;
|
val = uhp->uh_save_nr;
|
||||||
else
|
} else {
|
||||||
val = uhp->uh_seq;
|
val = uhp->uh_seq;
|
||||||
|
}
|
||||||
|
|
||||||
if (round == 1 && !(dofile && val == 0)) {
|
if (round == 1 && !(dofile && val == 0)) {
|
||||||
/* Remember the header that is closest to the target.
|
/* Remember the header that is closest to the target.
|
||||||
|
@ -803,7 +803,7 @@ static const int included_patches[] = {
|
|||||||
// 152 NA
|
// 152 NA
|
||||||
// 151,
|
// 151,
|
||||||
150,
|
150,
|
||||||
// 149,
|
149,
|
||||||
// 148,
|
// 148,
|
||||||
147,
|
147,
|
||||||
146,
|
146,
|
||||||
|
Loading…
Reference in New Issue
Block a user