Compare commits

...

12 Commits

Author SHA1 Message Date
d9dd30a955 Merge #12822 release-0.4 patches 2020-09-06 10:34:44 -07:00
b2cef8b665 terminal: fix terminal attribute overflow
fixes #11548
2020-09-05 21:59:22 -07:00
1de33ce2cd build: remove duplicate empty CONFIGURE_COMMAND (#12676)
The cmake file for libvterm had an empty CONFIGURE_COMMAND "", which tells cmake to skip the configure step for this dependency (even though a later patch added another, actual, CONFIGURE_COMMAND two lines below). Evidently the recently released cmake 3.18.0 is pickier about this than previous versions, causing the build to fail. Removing this line makes the build successful again.
2020-09-01 01:13:37 -07:00
1c3afe4e25 doc: powershell is 'pwsh' on non-Windows OS 2020-09-01 01:07:23 -07:00
b92399d008 doc: update shellquote for powershell #11122
shellquote is not treated like shellxquote for non-quote values.
2020-09-01 01:07:09 -07:00
20070310a4 bump libvterm to 0.1.4 2020-09-01 00:31:43 -07:00
c685a2ef48 Merge pull request #12751 from jamessan/openbsd-ci
ci: bump openbsd image 6.5 -> 6.7
2020-08-11 20:36:13 -04:00
018ec2172b ci: bump openbsd image 6.5 -> 6.7
seems like 6.5 is not supported anymore.

(cherry picked from commit c4888b2bde)
2020-08-11 20:21:27 -04:00
87a88c8e42 Merge pull request #12746 from jamessan/libcallnr-0.4 2020-08-11 15:02:28 -04:00
47b84599df Merge remote-tracking branch 'upstream/release-0.4' into libcallnr-0.4 2020-08-11 07:33:42 -04:00
e813ec79c2 libcall: Use "int" for number argument
The libcall family of functions need to use "int" for both input and
output.  The output side was fixed in 9c42232 but I forgot about the
input side.
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch libcallnr
# Your branch is up to date with 'upstream/master'.
#
# Changes to be committed:
#	modified:   src/nvim/eval/funcs.c
#	modified:   src/nvim/os/dl.c
#
2020-08-08 08:53:35 -04:00
40dc1ba85c version bump 2020-08-04 20:46:17 -04:00
14 changed files with 62 additions and 21 deletions

View File

@ -1,17 +1,17 @@
# sourcehut CI: https://builds.sr.ht/~jmk/neovim
image: openbsd/6.5
image: openbsd/6.7
packages:
- autoconf-2.69p2
- automake-1.15.1
- cmake
- gettext-0.19.8.1p3
- gettext-tools-0.19.8.1
- gettext-runtime-0.20.1p1
- gettext-tools-0.20.1p3
- gmake
- libtool
- ninja-1.8.2p0
- unzip-6.0p11
- ninja-1.10.0
- unzip-6.0p13
sources:
- https://github.com/neovim/neovim

View File

@ -114,8 +114,8 @@ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
# version string, else they are combined with the result of `git describe`.
set(NVIM_VERSION_MAJOR 0)
set(NVIM_VERSION_MINOR 4)
set(NVIM_VERSION_PATCH 4)
set(NVIM_VERSION_PRERELEASE "") # for package maintainers
set(NVIM_VERSION_PATCH 5)
set(NVIM_VERSION_PRERELEASE "-dev") # for package maintainers
# API level
set(NVIM_API_LEVEL 6) # Bump this after any API change.

View File

@ -5168,8 +5168,9 @@ A jump table for the options with a short description can be found at |Q_op|.
Note that such processing is done after |:set| did its own round of
unescaping, so to keep yourself sane use |:let-&| like shown above.
*shell-powershell*
To use powershell (on Windows): >
set shell=powershell shellquote=( shellpipe=\| shellxquote=
To use powershell: >
let &shell = has('win32') ? 'powershell' : 'pwsh'
set shellquote= shellpipe=\| shellxquote=
set shellcmdflag=-NoLogo\ -NoProfile\ -ExecutionPolicy\ RemoteSigned\ -Command
set shellredir=\|\ Out-File\ -Encoding\ UTF8

View File

@ -26,6 +26,7 @@
</screenshots>
<releases>
<release date="2020-08-04" version="0.4.4"/>
<release date="2019-11-06" version="0.4.3"/>
<release date="2019-09-15" version="0.4.2"/>
<release date="2019-09-15" version="0.4.1"/>

View File

@ -12656,7 +12656,7 @@ static void libcall_common(typval_T *argvars, typval_T *rettv, int out_type)
// input variables
char *str_in = (in_type == VAR_STRING)
? (char *) argvars[2].vval.v_string : NULL;
int64_t int_in = argvars[2].vval.v_number;
int int_in = argvars[2].vval.v_number;
// output variables
char **str_out = (out_type == VAR_STRING)

View File

@ -20,8 +20,8 @@
typedef void (*gen_fn)(void);
typedef const char *(*str_str_fn)(const char *str);
typedef int (*str_int_fn)(const char *str);
typedef const char *(*int_str_fn)(int64_t i);
typedef int (*int_int_fn)(int64_t i);
typedef const char *(*int_str_fn)(int i);
typedef int (*int_int_fn)(int i);
/// os_libcall - call a function in a dynamic loadable library
///
@ -41,7 +41,7 @@ typedef int (*int_int_fn)(int64_t i);
bool os_libcall(const char *libname,
const char *funcname,
const char *argv,
int64_t argi,
int argi,
char **str_out,
int *int_out)
{

View File

@ -2692,8 +2692,8 @@ win_line (
off += col;
}
// wont highlight after 1024 columns
int term_attrs[1024] = {0};
// wont highlight after TERM_ATTRS_MAX columns
int term_attrs[TERM_ATTRS_MAX] = { 0 };
if (wp->w_buffer->terminal) {
terminal_get_line_attributes(wp->w_buffer->terminal, wp, lnum, term_attrs);
extra_check = true;
@ -4030,7 +4030,7 @@ win_line (
int n = wp->w_p_rl ? -1 : 1;
while (col >= 0 && col < grid->Columns) {
schar_from_ascii(linebuf_char[off], ' ');
linebuf_attr[off] = term_attrs[vcol];
linebuf_attr[off] = vcol >= TERM_ATTRS_MAX ? 0 : term_attrs[vcol];
off += n;
vcol += n;
col += n;

View File

@ -32,6 +32,9 @@ EXTERN ScreenGrid default_grid INIT(= SCREEN_GRID_INIT);
#define DEFAULT_GRID_HANDLE 1 // handle for the default_grid
// Maximum columns for terminal highlight attributes
#define TERM_ATTRS_MAX 1024
/// Status line click definition
typedef struct {
enum {

View File

@ -588,6 +588,7 @@ void terminal_get_line_attributes(Terminal *term, win_T *wp, int linenr,
return;
}
width = MIN(TERM_ATTRS_MAX, width);
for (int col = 0; col < width; col++) {
VTermScreenCell cell;
bool color_valid = fetch_cell(term, row, col, &cell);

View File

@ -500,9 +500,20 @@ function module.source(code)
end
function module.set_shell_powershell()
local shell = iswin() and 'powershell' or 'pwsh'
if not module.eval('executable("'..shell..'")') then
error(shell..' is not executable')
end
local aliases = iswin() and {'cat', 'sleep'} or {}
local cmd = ''
for _, alias in ipairs(aliases) do
cmd = cmd .. 'Remove-Item -Force alias:' .. alias .. ';'
end
module.source([[
set shell=powershell shellquote=( shellpipe=\| shellredir=> shellxquote=
let &shellcmdflag = '-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command Remove-Item -Force alias:sleep; Remove-Item -Force alias:cat;'
let &shell = ']]..shell..[['
set shellquote= shellpipe=\| shellxquote=
let &shellredir = '| Out-File -Encoding UTF8'
let &shellcmdflag = '-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command ]]..cmd..[['
]])
end

View File

@ -264,3 +264,12 @@ describe('No heap-buffer-overflow when using', function()
feed_command('bdelete!')
end)
end)
describe('No heap-buffer-overflow when', function()
it('set nowrap and send long line #11548', function()
feed_command('set nowrap')
feed_command('autocmd TermOpen * startinsert')
feed_command('call feedkeys("4000ai\\<esc>:terminal!\\<cr>")')
eq(2, eval('1+1'))
end)
end)

View File

@ -10,6 +10,7 @@ local iswin = helpers.iswin
local clear = helpers.clear
local command = helpers.command
local nvim_dir = helpers.nvim_dir
local set_shell_powershell = helpers.set_shell_powershell
describe("shell command :!", function()
local screen
@ -230,4 +231,19 @@ describe("shell command :!", function()
]])
end)
end)
if iswin() or eval('executable("pwsh")') == 1 then
it('powershell supports literal strings', function()
set_shell_powershell()
local screen = Screen.new(30, 4)
screen:attach()
feed_command([[!'echo $a']])
screen:expect{any='\necho %$a', timeout=10000}
feed_command([[!$a = 1; echo '$a']])
screen:expect{any='\n%$a', timeout=10000}
feed_command([[!"echo $a"]])
screen:expect{any='\necho', timeout=10000}
feed_command([[!$a = 1; echo "$a"]])
screen:expect{any='\n1', timeout=10000}
end)
end
end)

View File

@ -160,8 +160,8 @@ set(UNIBILIUM_SHA256 29815283c654277ef77a3adcc8840db79ddbb20a0f0b0c8f648bd8cd49a
set(LIBTERMKEY_URL http://www.leonerd.org.uk/code/libtermkey/libtermkey-0.21.1.tar.gz)
set(LIBTERMKEY_SHA256 cecbf737f35d18f433c8d7864f63c0f878af41f8bd0255a3ebb16010dc044d5f)
set(LIBVTERM_URL https://github.com/neovim/libvterm/archive/7c72294d84ce20da4c27362dbd7fa4b08cfc91da.tar.gz)
set(LIBVTERM_SHA256 f30c4d43e0c6db3e0912daf7188d98fbf6ee88f97589d72f6f304e5db48826a8)
set(LIBVTERM_URL http://www.leonerd.org.uk/code/libvterm/libvterm-0.1.4.tar.gz)
set(LIBVTERM_SHA256 bc70349e95559c667672fc8c55b9527d9db9ada0fb80a3beda533418d782d3dd)
set(LUV_VERSION 1.30.0-0)
set(LUV_URL https://github.com/luvit/luv/archive/${LUV_VERSION}.tar.gz)

View File

@ -27,7 +27,6 @@ function(BuildLibvterm)
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
PATCH_COMMAND "${_libvterm_PATCH_COMMAND}"
CONFIGURE_COMMAND ""
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND "${_libvterm_CONFIGURE_COMMAND}"
BUILD_COMMAND "${_libvterm_BUILD_COMMAND}"