aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/vim-patch.sh6
-rw-r--r--src/nvim/lua/vim.lua4
2 files changed, 5 insertions, 5 deletions
diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh
index 6dd411a34e..9ea43383b6 100755
--- a/scripts/vim-patch.sh
+++ b/scripts/vim-patch.sh
@@ -85,12 +85,12 @@ get_vim_sources() {
git clone https://github.com/vim/vim.git "${VIM_SOURCE_DIR}"
cd "${VIM_SOURCE_DIR}"
else
- if [[ ! -d "${VIM_SOURCE_DIR}/.git" ]]; then
+ cd "${VIM_SOURCE_DIR}"
+ if [[ "$(git rev-parse --show-toplevel)" != "${VIM_SOURCE_DIR}" ]]; then
msg_err "${VIM_SOURCE_DIR} does not appear to be a git repository."
echo " Please remove it and try again."
exit 1
fi
- cd "${VIM_SOURCE_DIR}"
echo "Updating Vim sources: ${VIM_SOURCE_DIR}"
git pull &&
msg_ok "Updated Vim sources." ||
@@ -202,7 +202,7 @@ get_vimpatch() {
printf "Pre-processing patch...\n"
preprocess_patch "${NVIM_SOURCE_DIR}/${patch_file}"
- msg_ok "Saved patch to '${NVIM_SOURCE_DIR}/${patch_file}'.\n"
+ msg_ok "Saved patch to '${NVIM_SOURCE_DIR}/${patch_file}'."
}
stage_patch() {
diff --git a/src/nvim/lua/vim.lua b/src/nvim/lua/vim.lua
index e1bbb03d3f..47f40da72e 100644
--- a/src/nvim/lua/vim.lua
+++ b/src/nvim/lua/vim.lua
@@ -13,7 +13,7 @@ local function _os_proc_info(pid)
if pid == nil or pid <= 0 or type(pid) ~= 'number' then
error('invalid pid')
end
- local cmd = { 'ps', '-p', pid, '-o', 'ucomm=', }
+ local cmd = { 'ps', '-p', pid, '-o', 'comm=', }
local err, name = _system(cmd)
if 1 == err and string.gsub(name, '%s*', '') == '' then
return {} -- Process not found.
@@ -23,7 +23,7 @@ local function _os_proc_info(pid)
end
local _, ppid = _system({ 'ps', '-p', pid, '-o', 'ppid=', })
-- Remove trailing whitespace.
- name = string.gsub(name, '%s+$', '')
+ name = string.gsub(string.gsub(name, '%s+$', ''), '^.*/', '')
ppid = string.gsub(ppid, '%s+$', '')
ppid = tonumber(ppid) == nil and -1 or tonumber(ppid)
return {