mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-07 15:37:14 +02:00
Merge remote-tracking branch 'vim/master'
This commit is contained in:
@@ -191,9 +191,6 @@
|
||||
# ifndef WIN32
|
||||
# define mch_access(n, p) access((n), (p))
|
||||
# endif
|
||||
# if !(defined(FEAT_MBYTE) && defined(WIN3264))
|
||||
# define mch_fopen(n, p) fopen((n), (p))
|
||||
# endif
|
||||
# define mch_fstat(n, p) fstat((n), (p))
|
||||
# ifdef MSWIN /* has it's own mch_stat() function */
|
||||
# define mch_stat(n, p) vim_stat((n), (p))
|
||||
@@ -223,10 +220,6 @@
|
||||
* but it is not recommended, because it can destroy indexes etc.
|
||||
*/
|
||||
# define mch_open(n, m, p) open(vms_fixfilename(n), (m), (p))
|
||||
# else
|
||||
# if !(defined(FEAT_MBYTE) && defined(WIN3264))
|
||||
# define mch_open(n, m, p) open((n), (m), (p))
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
+13
-13
@@ -5338,6 +5338,17 @@ mch_job_start(char **argv, job_T *job, jobopt_T *options)
|
||||
if (use_null_for_in || use_null_for_out || use_null_for_err)
|
||||
null_fd = open("/dev/null", O_RDWR | O_EXTRA, 0);
|
||||
|
||||
if (pty_slave_fd >= 0)
|
||||
{
|
||||
/* push stream discipline modules */
|
||||
SetupSlavePTY(pty_slave_fd);
|
||||
# ifdef TIOCSCTTY
|
||||
/* Try to become controlling tty (probably doesn't work,
|
||||
* unless run by root) */
|
||||
ioctl(pty_slave_fd, TIOCSCTTY, (char *)NULL);
|
||||
# endif
|
||||
}
|
||||
|
||||
/* set up stdin for the child */
|
||||
close(0);
|
||||
if (use_null_for_in && null_fd >= 0)
|
||||
@@ -5384,24 +5395,13 @@ mch_job_start(char **argv, job_T *job, jobopt_T *options)
|
||||
close(fd_err[1]);
|
||||
if (pty_master_fd >= 0)
|
||||
{
|
||||
close(pty_master_fd); /* not used */
|
||||
close(pty_slave_fd); /* duped above */
|
||||
close(pty_master_fd); /* not used in the child */
|
||||
close(pty_slave_fd); /* was duped above */
|
||||
}
|
||||
|
||||
if (null_fd >= 0)
|
||||
close(null_fd);
|
||||
|
||||
if (pty_slave_fd >= 0)
|
||||
{
|
||||
/* push stream discipline modules */
|
||||
SetupSlavePTY(pty_slave_fd);
|
||||
# ifdef TIOCSCTTY
|
||||
/* Try to become controlling tty (probably doesn't work,
|
||||
* unless run by root) */
|
||||
ioctl(pty_slave_fd, TIOCSCTTY, (char *)NULL);
|
||||
# endif
|
||||
}
|
||||
|
||||
/* See above for type of argv. */
|
||||
execvp(argv[0], argv);
|
||||
|
||||
|
||||
+5
-4
@@ -111,6 +111,7 @@ typedef int HICON;
|
||||
typedef int HINSTANCE;
|
||||
typedef int HWND;
|
||||
typedef int INPUT_RECORD;
|
||||
typedef int INT;
|
||||
typedef int KEY_EVENT_RECORD;
|
||||
typedef int LOGFONT;
|
||||
typedef int LPBOOL;
|
||||
@@ -657,13 +658,13 @@ null_libintl_textdomain(const char *domainname UNUSED)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
null_libintl_putenv(const char *envstring UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
null_libintl_wputenv(const wchar_t *envstring UNUSED)
|
||||
{
|
||||
return 0;
|
||||
@@ -6503,7 +6504,7 @@ getout:
|
||||
* Version of open() that may use UTF-16 file name.
|
||||
*/
|
||||
int
|
||||
mch_open(char *name, int flags, int mode)
|
||||
mch_open(const char *name, int flags, int mode)
|
||||
{
|
||||
/* _wopen() does not work with Borland C 5.5: creates a read-only file. */
|
||||
# ifndef __BORLANDC__
|
||||
@@ -6536,7 +6537,7 @@ mch_open(char *name, int flags, int mode)
|
||||
* Version of fopen() that may use UTF-16 file name.
|
||||
*/
|
||||
FILE *
|
||||
mch_fopen(char *name, char *mode)
|
||||
mch_fopen(const char *name, const char *mode)
|
||||
{
|
||||
WCHAR *wn, *wm;
|
||||
FILE *f = NULL;
|
||||
|
||||
@@ -56,8 +56,8 @@ int mch_wrename(WCHAR *wold, WCHAR *wnew);
|
||||
int mch_rename(const char *pszOldFile, const char *pszNewFile);
|
||||
char *default_shell(void);
|
||||
int mch_access(char *n, int p);
|
||||
int mch_open(char *name, int flags, int mode);
|
||||
FILE *mch_fopen(char *name, char *mode);
|
||||
int mch_open(const char *name, int flags, int mode);
|
||||
FILE *mch_fopen(const char *name, const char *mode);
|
||||
int mch_copy_file_attribute(char_u *from, char_u *to);
|
||||
int myresetstkoflw(void);
|
||||
int get_cmd_argsW(char ***argvp);
|
||||
|
||||
+3
-1
@@ -973,7 +973,7 @@ terminal_loop(void)
|
||||
/* We don't know if the job can handle CTRL-C itself or not, this
|
||||
* may kill the shell instead of killing the command running in the
|
||||
* shell. */
|
||||
mch_stop_job(curbuf->b_term->tl_job, "quit")
|
||||
mch_stop_job(curbuf->b_term->tl_job, (char_u *)"quit")
|
||||
#endif
|
||||
|
||||
if (c == (termkey == 0 ? Ctrl_W : termkey))
|
||||
@@ -1852,6 +1852,8 @@ f_term_getline(typval_T *argvars, typval_T *rettv)
|
||||
int len;
|
||||
char_u *p;
|
||||
|
||||
if (row < 0 || row >= term->tl_rows)
|
||||
return;
|
||||
len = term->tl_cols * MB_MAXBYTES + 1;
|
||||
p = alloc(len);
|
||||
if (p == NULL)
|
||||
|
||||
@@ -81,6 +81,10 @@ func Test_terminal_hide_buffer()
|
||||
endfunc
|
||||
|
||||
func Check_123(buf)
|
||||
let l = term_scrape(a:buf, 0)
|
||||
call assert_true(len(l) == 0)
|
||||
let l = term_scrape(a:buf, 999)
|
||||
call assert_true(len(l) == 0)
|
||||
let l = term_scrape(a:buf, 1)
|
||||
call assert_true(len(l) > 0)
|
||||
call assert_equal('1', l[0].chars)
|
||||
@@ -93,6 +97,12 @@ func Check_123(buf)
|
||||
call assert_equal('#000000', l[0].bg)
|
||||
endif
|
||||
|
||||
let l = term_getline(a:buf, -1)
|
||||
call assert_equal('', l)
|
||||
let l = term_getline(a:buf, 0)
|
||||
call assert_equal('', l)
|
||||
let l = term_getline(a:buf, 999)
|
||||
call assert_equal('', l)
|
||||
let l = term_getline(a:buf, 1)
|
||||
call assert_equal('123', l)
|
||||
endfunc
|
||||
|
||||
@@ -784,6 +784,16 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
844,
|
||||
/**/
|
||||
843,
|
||||
/**/
|
||||
842,
|
||||
/**/
|
||||
841,
|
||||
/**/
|
||||
840,
|
||||
/**/
|
||||
839,
|
||||
/**/
|
||||
|
||||
@@ -2144,6 +2144,11 @@ typedef enum {
|
||||
# define number_width(x) 7
|
||||
#endif
|
||||
|
||||
/* This must come after including proto.h */
|
||||
#if !(defined(FEAT_MBYTE) && defined(WIN3264))
|
||||
# define mch_open(n, m, p) open((n), (m), (p))
|
||||
# define mch_fopen(n, p) fopen((n), (p))
|
||||
#endif
|
||||
|
||||
#include "globals.h" /* global variables and messages */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user