aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/autoload/health/provider.vim2
-rw-r--r--runtime/autoload/provider/ruby.vim12
-rw-r--r--runtime/doc/provider.txt13
-rwxr-xr-xscripts/genappimage.sh11
-rwxr-xr-xscripts/pvscheck.sh33
-rw-r--r--src/nvim/ops.c3
-rw-r--r--src/nvim/os/shell.c8
-rw-r--r--src/nvim/search.c7
-rw-r--r--src/nvim/testdir/Makefile1
-rw-r--r--src/nvim/testdir/test_search.vim12
-rw-r--r--src/nvim/version.c2
11 files changed, 69 insertions, 35 deletions
diff --git a/runtime/autoload/health/provider.vim b/runtime/autoload/health/provider.vim
index 6183182b73..31a235a397 100644
--- a/runtime/autoload/health/provider.vim
+++ b/runtime/autoload/health/provider.vim
@@ -460,7 +460,7 @@ function! s:check_ruby() abort
\ 'Are you behind a firewall or proxy?'])
return
endif
- let latest_gem = get(split(latest_gem, ' (\|, \|)$' ), 1, 'not found')
+ let latest_gem = get(split(latest_gem, 'neovim (\|, \|)$' ), 1, 'not found')
let current_gem_cmd = host .' --version'
let current_gem = s:system(current_gem_cmd)
diff --git a/runtime/autoload/provider/ruby.vim b/runtime/autoload/provider/ruby.vim
index c8ede20a75..91b7fb9f2c 100644
--- a/runtime/autoload/provider/ruby.vim
+++ b/runtime/autoload/provider/ruby.vim
@@ -16,7 +16,11 @@ function! s:job_opts.on_stderr(chan_id, data, event)
endfunction
function! provider#ruby#Detect() abort
- return exepath('neovim-ruby-host')
+ if exists("g:ruby_host_prog")
+ return g:ruby_host_prog
+ else
+ return exepath('neovim-ruby-host')
+ end
endfunction
function! provider#ruby#Prog()
@@ -24,15 +28,15 @@ function! provider#ruby#Prog()
endfunction
function! provider#ruby#Require(host) abort
- let args = [provider#ruby#Prog()]
+ let prog = provider#ruby#Prog()
let ruby_plugins = remote#host#PluginsForHost(a:host.name)
for plugin in ruby_plugins
- call add(args, plugin.path)
+ let prog .= " " . shellescape(plugin.path)
endfor
try
- let channel_id = jobstart(args, s:job_opts)
+ let channel_id = jobstart(prog, s:job_opts)
if rpcrequest(channel_id, 'poll') ==# 'ok'
return channel_id
endif
diff --git a/runtime/doc/provider.txt b/runtime/doc/provider.txt
index 8d1dd0a6cd..435646bd1c 100644
--- a/runtime/doc/provider.txt
+++ b/runtime/doc/provider.txt
@@ -99,6 +99,19 @@ RUBY PROVIDER CONFIGURATION ~
*g:loaded_ruby_provider*
To disable Ruby support: >
let g:loaded_ruby_provider = 1
+<
+ *g:ruby_host_prog*
+Command to start the Ruby host. By default this is `neovim-ruby-host`. For users
+who use per-project Ruby versions with tools like RVM or rbenv, setting this can
+prevent the need to install the `neovim` gem in every project.
+
+To use an absolute path (e.g. to an rbenv installation): >
+ let g:ruby_host_prog = '~/.rbenv/versions/2.4.1/bin/neovim-ruby-host'
+<
+
+To use the RVM "system" Ruby installation: >
+ let g:ruby_host_prog = 'rvm system do neovim-ruby-host'
+<
==============================================================================
Clipboard integration *provider-clipboard* *clipboard*
diff --git a/scripts/genappimage.sh b/scripts/genappimage.sh
index fd7247b947..a73ccd86c7 100755
--- a/scripts/genappimage.sh
+++ b/scripts/genappimage.sh
@@ -18,23 +18,22 @@ ROOT_DIR="$(git rev-parse --show-toplevel)"
APP_BUILD_DIR="$ROOT_DIR/build"
APP_DIR="$APP.AppDir"
-# App version, used by generate_appimage.
-VERSION=$("$ROOT_DIR"/build/bin/nvim --version | head -n 1 | grep -o 'v.*')
-
########################################################################
# Compile nvim and install it into AppDir
########################################################################
# Build and install nvim into the AppImage
-make CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=${APP_DIR}/usr"
+make CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=${APP_DIR}/usr -DCMAKE_INSTALL_MANDIR=man"
make install
########################################################################
# Get helper functions and move to AppDir
########################################################################
+# App version, used by generate_appimage.
+VERSION=$("$ROOT_DIR"/build/bin/nvim --version | head -n 1 | grep -o 'v.*')
+
cd "$APP_BUILD_DIR"
-mkdir "$APP_DIR"
curl -Lo "$APP_BUILD_DIR"/appimage_functions.sh https://github.com/probonopd/AppImages/raw/master/functions.sh
. ./appimage_functions.sh
@@ -80,3 +79,5 @@ generate_appimage
mv "$ROOT_DIR"/out/*.AppImage "$ROOT_DIR"/build/bin
# Remove the (now empty) folder the AppImage was built in
rmdir "$ROOT_DIR"/out
+
+echo 'genappimage.sh: finished'
diff --git a/scripts/pvscheck.sh b/scripts/pvscheck.sh
index d6d28e3c6c..535f14beb4 100755
--- a/scripts/pvscheck.sh
+++ b/scripts/pvscheck.sh
@@ -1,14 +1,15 @@
#!/bin/sh
+
+# Assume that "local" is available.
+# shellcheck disable=SC2039
+
set -e
# Note: -u causes problems with posh, it barks at “undefined” $@ when no
# arguments provided.
test -z "$POSH_VERSION" && set -u
-get_jobs_num() {
- local num="$(cat /proc/cpuinfo | grep -c "^processor")"
- num="$(echo $(( num + 1 )))"
- num="${num:-1}"
- echo $num
+echo_jobs_num() {
+ echo $(( $(grep -c "^processor" /proc/cpuinfo) + 1 ))
}
help() {
@@ -21,7 +22,7 @@ help() {
echo ' --pvs: Use the specified URL as a path to pvs-studio archive.'
echo ' By default latest tested version is used.'
echo
- echo ' May use `--pvs detect` to try detecting latest version.'
+ echo ' May use "--pvs detect" to try detecting latest version.'
echo ' That assumes certain viva64.com site properties and'
echo ' may be broken by the site update.'
echo
@@ -261,15 +262,6 @@ install_pvs() {(
rmdir "$pvsdir"
)}
-adjust_path() {
- if test -d "$tgt/pvs-studio" ; then
- local saved_pwd="$PWD"
- cd "$tgt/pvs-studio"
- export PATH="$PWD/bin${PATH+:}${PATH}"
- cd "$saved_pwd"
- fi
-}
-
create_compile_commands() {(
local tgt="$1" ; shift
local deps="$1" ; shift
@@ -283,13 +275,13 @@ create_compile_commands() {(
cd "$tgt/build"
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX="$PWD/root"
- make -j"$(get_jobs_num)"
+ make -j"$(echo_jobs_num)"
)
else
(
cd "$tgt"
- make -j"$(get_jobs_num)" CMAKE_EXTRA_FLAGS=" -DCMAKE_INSTALL_PREFIX=$PWD/root -DCMAKE_BUILD_TYPE=Debug "
+ make -j"$(echo_jobs_num)" CMAKE_EXTRA_FLAGS=" -DCMAKE_INSTALL_PREFIX=$PWD/root -DCMAKE_BUILD_TYPE=Debug "
)
fi
find "$tgt/build/src/nvim/auto" -name '*.test-include.c' -delete
@@ -379,7 +371,12 @@ do_recheck() {
do_analysis() {
local tgt="$1" ; shift
- adjust_path "$tgt"
+ if test -d "$tgt/pvs-studio" ; then
+ local saved_pwd="$PWD"
+ cd "$tgt/pvs-studio"
+ export PATH="$PWD/bin${PATH+:}${PATH}"
+ cd "$saved_pwd"
+ fi
run_analysis "$tgt"
}
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index c5660f68fd..f9153a94a7 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -1408,6 +1408,9 @@ int op_delete(oparg_T *oap)
}
if (oap->regname == 0) {
+ if (reg == NULL) {
+ abort();
+ }
set_clipboard(0, reg);
do_autocmd_textyankpost(oap, reg);
}
diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c
index 8767287cf3..9d80a43718 100644
--- a/src/nvim/os/shell.c
+++ b/src/nvim/os/shell.c
@@ -496,8 +496,12 @@ static void out_data_cb(Stream *stream, RBuffer *buf, size_t count, void *data,
size_t cnt;
char *ptr = rbuffer_read_ptr(buf, &cnt);
- if (ptr != NULL && cnt > 0
- && out_data_decide_throttle(cnt)) { // Skip output above a threshold.
+ if (ptr == NULL || cnt == 0) {
+ // Nothing to read;
+ return;
+ }
+
+ if (out_data_decide_throttle(cnt)) { // Skip output above a threshold.
// Save the skipped output. If it is the final chunk, we display it later.
out_data_ring(ptr, cnt);
} else {
diff --git a/src/nvim/search.c b/src/nvim/search.c
index 61ef2e9ba3..1bf2317d2a 100644
--- a/src/nvim/search.c
+++ b/src/nvim/search.c
@@ -1005,14 +1005,13 @@ int do_search(
dircp = NULL;
/* use previous pattern */
if (pat == NULL || *pat == NUL || *pat == dirc) {
- if (spats[RE_SEARCH].pat == NULL) { /* no previous pattern */
- pat = spats[RE_SUBST].pat;
- if (pat == NULL) {
+ if (spats[RE_SEARCH].pat == NULL) { // no previous pattern
+ searchstr = spats[RE_SUBST].pat;
+ if (searchstr == NULL) {
EMSG(_(e_noprevre));
retval = 0;
goto end_do_search;
}
- searchstr = pat;
} else {
/* make search_regcomp() use spats[RE_SEARCH].pat */
searchstr = (char_u *)"";
diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile
index 3482001f63..7e55fffa06 100644
--- a/src/nvim/testdir/Makefile
+++ b/src/nvim/testdir/Makefile
@@ -58,6 +58,7 @@ NEW_TESTS ?= \
test_nested_function.res \
test_normal.res \
test_quickfix.res \
+ test_search.res \
test_signs.res \
test_smartindent.res \
test_stat.res \
diff --git a/src/nvim/testdir/test_search.vim b/src/nvim/testdir/test_search.vim
new file mode 100644
index 0000000000..e85525e663
--- /dev/null
+++ b/src/nvim/testdir/test_search.vim
@@ -0,0 +1,12 @@
+" Test for the search command
+
+func Test_use_sub_pat()
+ split
+ let @/ = ''
+ func X()
+ s/^/a/
+ /
+ endfunc
+ call X()
+ bwipe!
+endfunc
diff --git a/src/nvim/version.c b/src/nvim/version.c
index c8300e786e..a28dbcf061 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -88,7 +88,7 @@ static const int included_patches[] = {
2359,
// 2358 NA
2357,
- // 2356,
+ 2356,
2355,
// 2354,
2353,