aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt6
-rw-r--r--ci/common/suite.sh28
-rw-r--r--runtime/filetype.vim4
-rw-r--r--runtime/lua/vim/lsp/util.lua2
-rwxr-xr-xscripts/vim-patch.sh57
-rwxr-xr-xsrc/nvim/testdir/runnvim.sh4
-rw-r--r--src/nvim/testdir/test_filetype.vim2
7 files changed, 51 insertions, 52 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9f1829cf55..0c43c5c494 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -543,7 +543,11 @@ endif()
message(STATUS "Using Lua interpreter: ${LUA_PRG}")
-option(COMPILE_LUA "Pre-compile Lua sources into bytecode (for sources that are included in the binary)" ON)
+if(DEBUG)
+ option(COMPILE_LUA "Pre-compile Lua sources into bytecode (for sources that are included in the binary)" OFF)
+else()
+ option(COMPILE_LUA "Pre-compile Lua sources into bytecode (for sources that are included in the binary)" ON)
+endif()
if(COMPILE_LUA AND NOT WIN32)
if(PREFER_LUA)
diff --git a/ci/common/suite.sh b/ci/common/suite.sh
index 2591ea37a5..561849ce2d 100644
--- a/ci/common/suite.sh
+++ b/ci/common/suite.sh
@@ -11,22 +11,10 @@ FAIL_SUMMARY=""
END_MARKER="$BUILD_DIR/.tests_finished"
FAIL_SUMMARY_FILE="$BUILD_DIR/.test_errors"
-ANSI_CLEAR="\033[0K"
-
-if test "$TRAVIS" = "true"; then
- ci_fold() {
- local action="$1"
- local name="$2"
- name="$(echo -n "$name" | tr '\n\0' '--' | sed 's/[^A-Za-z0-9]\{1,\}/-/g')"
- name="$(echo -n "$name" | sed 's/-$//')"
- echo -en "travis_fold:${action}:${name}\r${ANSI_CLEAR}"
- }
-elif test "$GITHUB_ACTIONS" = "true"; then
- ci_fold() {
+ci_fold() {
+ if test "$GITHUB_ACTIONS" = "true"; then
local action="$1"
local name="$2"
- name="$(echo -n "$name" | tr '\n\0' '--' | sed 's/[^A-Za-z0-9]\{1,\}/-/g')"
- name="$(echo -n "$name" | sed 's/-$//')"
case "$action" in
start)
echo "::group::${name}"
@@ -37,12 +25,8 @@ elif test "$GITHUB_ACTIONS" = "true"; then
*)
:;;
esac
- }
-else
- ci_fold() {
- return 0
- }
-fi
+ fi
+}
enter_suite() {
set +x
@@ -50,7 +34,7 @@ enter_suite() {
rm -f "${END_MARKER}"
local suite_name="$1"
export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE}/$suite_name"
- ci_fold start "${NVIM_TEST_CURRENT_SUITE}"
+ ci_fold "start" "$suite_name"
set -x
}
@@ -60,7 +44,7 @@ exit_suite() {
echo "Suite ${NVIM_TEST_CURRENT_SUITE} failed, summary:"
echo "${FAIL_SUMMARY}"
else
- ci_fold end "${NVIM_TEST_CURRENT_SUITE}"
+ ci_fold "end" ""
fi
export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE%/*}"
if test "$1" != "--continue" ; then
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 1f9b90ed78..07969b3418 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1774,8 +1774,8 @@ au BufNewFile,BufRead *.sqr,*.sqi setf sqr
au BufNewFile,BufRead *.nut setf squirrel
" OpenSSH configuration
-au BufNewFile,BufRead ssh_config,*/.ssh/config setf sshconfig
-au BufNewFile,BufRead */etc/ssh/ssh_config.d/*.conf setf sshconfig
+au BufNewFile,BufRead ssh_config,*/.ssh/config,*/.ssh/*.conf setf sshconfig
+au BufNewFile,BufRead */etc/ssh/ssh_config.d/*.conf setf sshconfig
" OpenSSH server configuration
au BufNewFile,BufRead sshd_config setf sshdconfig
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua
index 603ed0d290..dcd68a3433 100644
--- a/runtime/lua/vim/lsp/util.lua
+++ b/runtime/lua/vim/lsp/util.lua
@@ -1505,7 +1505,7 @@ do --[[ References ]]
---@param bufnr number Buffer id
function M.buf_clear_references(bufnr)
validate { bufnr = {bufnr, 'n', true} }
- api.nvim_buf_clear_namespace(bufnr, reference_ns, 0, -1)
+ api.nvim_buf_clear_namespace(bufnr or 0, reference_ns, 0, -1)
end
--- Shows a list of document highlights for a certain buffer.
diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh
index ac47f6aafd..1c265f0f40 100755
--- a/scripts/vim-patch.sh
+++ b/scripts/vim-patch.sh
@@ -266,8 +266,6 @@ get_vimpatch() {
msg_ok "Saved patch to '${NVIM_SOURCE_DIR}/${patch_file}'."
}
-# shellcheck disable=SC2015
-# ^ "Note that A && B || C is not if-then-else."
stage_patch() {
get_vimpatch "$1"
local try_apply="${2:-}"
@@ -282,23 +280,32 @@ stage_patch() {
echo " branch; not creating a new branch."
else
printf '\nFetching "%s/master".\n' "${nvim_remote}"
- output="$(git fetch "${nvim_remote}" master 2>&1)" &&
- msg_ok "${output}" ||
- (msg_err "${output}"; false)
+ if output="$(git fetch "$nvim_remote" master 2>&1)"; then
+ msg_ok "$output"
+ else
+ msg_err "$output"
+ exit 1
+ fi
local nvim_branch="${BRANCH_PREFIX}${vim_version}"
echo
echo "Creating new branch '${nvim_branch}' based on '${nvim_remote}/master'."
cd "${NVIM_SOURCE_DIR}"
- output="$(git checkout -b "${nvim_branch}" "${nvim_remote}/master" 2>&1)" &&
- msg_ok "${output}" ||
- (msg_err "${output}"; false)
+ if output="$(git checkout -b "$nvim_branch" "$nvim_remote/master" 2>&1)"; then
+ msg_ok "$output"
+ else
+ msg_err "$output"
+ exit 1
+ fi
fi
printf "\nCreating empty commit with correct commit message.\n"
- output="$(commit_message | git commit --allow-empty --file 2>&1 -)" &&
- msg_ok "${output}" ||
- (msg_err "${output}"; false)
+ if output="$(commit_message | git commit --allow-empty --file 2>&1 -)"; then
+ msg_ok "$output"
+ else
+ msg_err "$output"
+ exit 1
+ fi
local ret=0
if test -n "$try_apply" ; then
@@ -340,8 +347,6 @@ git_hub_pr() {
git hub pull new -m "${pr_message}"
}
-# shellcheck disable=SC2015
-# ^ "Note that A && B || C is not if-then-else."
submit_pr() {
require_executable git
local push_first
@@ -392,17 +397,23 @@ submit_pr() {
fi
fi
echo "Pushing to '${push_remote}/${checked_out_branch}'."
- output="$(git push "${push_remote}" "${checked_out_branch}" 2>&1)" &&
- msg_ok "${output}" ||
- (msg_err "${output}"; false)
+ if output="$(git push "$push_remote" "$checked_out_branch" 2>&1)"; then
+ msg_ok "$output"
+ else
+ msg_err "$output"
+ exit 1
+ fi
echo
fi
echo "Creating pull request."
- output="$(${submit_fn} "${pr_title}" "${pr_body}" 2>&1)" &&
- msg_ok "${output}" ||
- (msg_err "${output}"; false)
+ if output="$($submit_fn "$pr_title" "$pr_body" 2>&1)"; then
+ msg_ok "$output"
+ else
+ msg_err "$output"
+ exit 1
+ fi
echo
echo "Cleaning up files."
@@ -565,13 +576,13 @@ show_vimpatches() {
runtime_commits[$commit]=1
done
- list_missing_vimpatches 1 "$@" | while read -r vim_commit; do
+ while read -r vim_commit; do
if [[ "${runtime_commits[$vim_commit]-}" ]]; then
printf ' • %s (+runtime)\n' "${vim_commit}"
else
printf ' • %s\n' "${vim_commit}"
fi
- done
+ done <<< "$(list_missing_vimpatches 1 "$@")"
cat << EOF
@@ -692,14 +703,14 @@ review_commit() {
message_length="$(wc -l <<< "${expected_commit_message}")"
local commit_message
commit_message="$(tail -n +4 "${NVIM_SOURCE_DIR}/n${patch_file}" | head -n "${message_length}")"
- if [[ "${commit_message#${git_patch_prefix}}" == "${expected_commit_message}" ]]; then
+ if [[ "${commit_message#"$git_patch_prefix"}" == "${expected_commit_message}" ]]; then
msg_ok "Found expected commit message."
else
msg_err "Wrong commit message."
echo " Expected:"
echo "${expected_commit_message}"
echo " Actual:"
- echo "${commit_message#${git_patch_prefix}}"
+ echo "${commit_message#"$git_patch_prefix"}"
fi
get_vimpatch "${vim_version}"
diff --git a/src/nvim/testdir/runnvim.sh b/src/nvim/testdir/runnvim.sh
index 25cb8437b4..fdd3f3144b 100755
--- a/src/nvim/testdir/runnvim.sh
+++ b/src/nvim/testdir/runnvim.sh
@@ -66,7 +66,7 @@ main() {(
fi
fi
if test "$FAILED" = 1 ; then
- ci_fold start "$NVIM_TEST_CURRENT_SUITE/$test_name"
+ ci_fold start "$test_name"
fi
valgrind_check .
if test -n "$LOG_DIR" ; then
@@ -78,7 +78,7 @@ main() {(
fi
rm -f "$tlog"
if test "$FAILED" = 1 ; then
- ci_fold end "$NVIM_TEST_CURRENT_SUITE/$test_name"
+ ci_fold end ""
fi
if test "$FAILED" = 1 ; then
echo "Test $test_name failed, see output above and summary for more details" >> test.log
diff --git a/src/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim
index 694e6faf21..4da68539fb 100644
--- a/src/nvim/testdir/test_filetype.vim
+++ b/src/nvim/testdir/test_filetype.vim
@@ -481,7 +481,7 @@ let s:filename_checks = {
\ 'squid': ['squid.conf'],
\ 'squirrel': ['file.nut'],
\ 'srec': ['file.s19', 'file.s28', 'file.s37', 'file.mot', 'file.srec'],
- \ 'sshconfig': ['ssh_config', '/.ssh/config', '/etc/ssh/ssh_config.d/file.conf', 'any/etc/ssh/ssh_config.d/file.conf', 'any/.ssh/config'],
+ \ 'sshconfig': ['ssh_config', '/.ssh/config', '/etc/ssh/ssh_config.d/file.conf', 'any/etc/ssh/ssh_config.d/file.conf', 'any/.ssh/config', 'any/.ssh/file.conf'],
\ 'sshdconfig': ['sshd_config', '/etc/ssh/sshd_config.d/file.conf', 'any/etc/ssh/sshd_config.d/file.conf'],
\ 'st': ['file.st'],
\ 'stata': ['file.ado', 'file.do', 'file.imata', 'file.mata'],