diff options
author | Daniel Hahler <git@thequod.de> | 2019-10-02 03:43:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-02 03:43:39 +0200 |
commit | e63fdf63ba057877573dbb3171a8c7ae698cf1bc (patch) | |
tree | 28baa93d934b2574883e0640e3ebce6394039e0f /src | |
parent | 60b56ed458c6b35d5045959192b49da5a0ea84f3 (diff) | |
parent | eef3809067ae0f613e30b711ef720415c7016381 (diff) | |
download | rneovim-e63fdf63ba057877573dbb3171a8c7ae698cf1bc.tar.gz rneovim-e63fdf63ba057877573dbb3171a8c7ae698cf1bc.tar.bz2 rneovim-e63fdf63ba057877573dbb3171a8c7ae698cf1bc.zip |
Merge pull request #11133 from blueyed/backports
[release-0.4] backports
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/lua/vim.lua | 2 | ||||
-rw-r--r-- | src/nvim/os/env.c | 11 | ||||
-rw-r--r-- | src/nvim/screen.c | 4 |
3 files changed, 13 insertions, 4 deletions
diff --git a/src/nvim/lua/vim.lua b/src/nvim/lua/vim.lua index a03e97490d..b1a684b977 100644 --- a/src/nvim/lua/vim.lua +++ b/src/nvim/lua/vim.lua @@ -189,7 +189,7 @@ paste = (function() if mode == 'c' and not got_line1 then -- cmdline-mode: paste only 1 line. got_line1 = (#lines > 1) vim.api.nvim_set_option('paste', true) -- For nvim_input(). - local line1, _ = string.gsub(lines[1], '[\r\n\012\027]', ' ') -- Scrub. + local line1 = lines[1]:gsub('<', '<lt>'):gsub('[\r\n\012\027]', ' ') -- Scrub. vim.api.nvim_input(line1) vim.api.nvim_set_option('paste', false) elseif mode ~= 'c' then -- Else: discard remaining cmdline-mode chunks. diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c index f5dbf0694e..54fdd7961c 100644 --- a/src/nvim/os/env.c +++ b/src/nvim/os/env.c @@ -135,7 +135,16 @@ int os_setenv(const char *name, const char *value, int overwrite) } #endif uv_mutex_lock(&mutex); - int r = uv_os_setenv(name, value); + int r; +#ifdef WIN32 + // libintl uses getenv() for LC_ALL/LANG/etc., so we must use _putenv_s(). + if (striequal(name, "LC_ALL") || striequal(name, "LANGUAGE") + || striequal(name, "LANG") || striequal(name, "LC_MESSAGES")) { + r = _putenv_s(name, value); // NOLINT + assert(r == 0); + } +#endif + r = uv_os_setenv(name, value); assert(r != UV_EINVAL); // Destroy the old map item. Do this AFTER uv_os_setenv(), because `value` // could be a previous os_getenv() result. diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 5bcd2c808d..f4aa10ecf5 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -871,7 +871,7 @@ static void win_update(win_T *wp) if (wp->w_lines[0].wl_lnum != wp->w_topline) i += diff_check_fill(wp, wp->w_lines[0].wl_lnum) - wp->w_old_topfill; - if (i < wp->w_grid.Rows - 2) { // less than a screen off + if (i != 0 && i < wp->w_grid.Rows - 2) { // less than a screen off // Try to insert the correct number of lines. // If not the last window, delete the lines at the bottom. // win_ins_lines may fail when the terminal can't do it. @@ -4007,7 +4007,7 @@ win_line ( break; } - ++vcol; + vcol += cells; } } |