aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorckelsel <ckelsel@hotmail.com>2017-07-28 08:38:08 +0800
committerckelsel <ckelsel@hotmail.com>2017-07-28 08:38:08 +0800
commit3e0536eb295309c728acca386ec35756b7e034f6 (patch)
treef4ef3ef657245cf6d96a3d777ae63c6fda5b11d0 /runtime
parent31c018244daa12caab3af357a368279a1f55d28c (diff)
parente6d54407ba8ce580fbd81cb9389eb9ce4483597b (diff)
downloadrneovim-3e0536eb295309c728acca386ec35756b7e034f6.tar.gz
rneovim-3e0536eb295309c728acca386ec35756b7e034f6.tar.bz2
rneovim-3e0536eb295309c728acca386ec35756b7e034f6.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'runtime')
-rw-r--r--runtime/CMakeLists.txt24
-rw-r--r--runtime/autoload/provider.vim18
-rw-r--r--runtime/autoload/provider/clipboard.vim15
-rw-r--r--runtime/autoload/provider/pythonx.vim16
-rw-r--r--runtime/doc/digraph.txt3
-rw-r--r--runtime/doc/eval.txt2
-rw-r--r--runtime/doc/map.txt1
7 files changed, 45 insertions, 34 deletions
diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt
index 69498dc1a1..a9efc90b87 100644
--- a/runtime/CMakeLists.txt
+++ b/runtime/CMakeLists.txt
@@ -100,20 +100,6 @@ add_custom_target(
${GENERATED_PACKAGE_TAGS}
)
-# Optional targets for nvim.desktop file and icon.
-find_program(XDG_MENU_PRG xdg-desktop-menu)
-find_program(XDG_ICON_PRG xdg-icon-resource)
-if(XDG_MENU_PRG)
- add_custom_target(desktop-file
- COMMAND xdg-desktop-menu install --novendor ${PROJECT_SOURCE_DIR}/runtime/nvim.desktop)
- # add_dependencies(runtime desktop-file)
-endif()
-if(XDG_ICON_PRG)
- add_custom_target(desktop-icon
- COMMAND xdg-icon-resource install --novendor --size 128 ${PROJECT_SOURCE_DIR}/runtime/nvim.png)
- # add_dependencies(runtime desktop-icon)
-endif()
-
# CMake is painful here. It will create the destination using the user's
# current umask, and we don't want that. And we don't just want to install
# the target directory, as it will mess with existing permissions. So this
@@ -128,6 +114,16 @@ install_helper(
FILES ${GENERATED_SYN_VIM}
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/syntax/vim)
+if(NOT APPLE)
+ install_helper(
+ FILES ${CMAKE_CURRENT_SOURCE_DIR}/nvim.desktop
+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
+
+ install_helper(
+ FILES ${CMAKE_CURRENT_SOURCE_DIR}/nvim.png
+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pixmaps)
+endif()
+
file(GLOB_RECURSE RUNTIME_PROGRAMS
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
*.awk *.sh *.bat)
diff --git a/runtime/autoload/provider.vim b/runtime/autoload/provider.vim
new file mode 100644
index 0000000000..a4d5241b57
--- /dev/null
+++ b/runtime/autoload/provider.vim
@@ -0,0 +1,18 @@
+" Common functionality for providers
+
+let s:stderr = {}
+
+function! provider#stderr_collector(chan_id, data, event) dict
+ let stderr = get(s:stderr, a:chan_id, [''])
+ let stderr[-1] .= a:data[0]
+ call extend(stderr, a:data[1:])
+ let s:stderr[a:chan_id] = stderr
+endfunction
+
+function! provider#clear_stderr(chan_id)
+ silent! call delete(s:stderr, a:chan_id)
+endfunction
+
+function! provider#get_stderr(chan_id)
+ return get(s:stderr, a:chan_id, [])
+endfunction
diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim
index 86006497d9..8eb694e9fa 100644
--- a/runtime/autoload/provider/clipboard.vim
+++ b/runtime/autoload/provider/clipboard.vim
@@ -6,7 +6,7 @@ let s:paste = {}
" When caching is enabled, store the jobid of the xclip/xsel process keeping
" ownership of the selection, so we know how long the cache is valid.
-let s:selection = { 'owner': 0, 'data': [] }
+let s:selection = { 'owner': 0, 'data': [], 'on_stderr': function('provider#stderr_collector') }
function! s:selection.on_exit(jobid, data, event) abort
" At this point this nvim instance might already have launched
@@ -14,12 +14,13 @@ function! s:selection.on_exit(jobid, data, event) abort
if self.owner == a:jobid
let self.owner = 0
endif
-endfunction
-
-function! s:selection.on_stderr(jobid, data, event) abort
- echohl WarningMsg
- echomsg 'clipboard: error invoking '.get(self.argv, 0, '?').': '.join(a:data)
- echohl None
+ if a:data != 0
+ let stderr = provider#get_stderr(a:jobid)
+ echohl WarningMsg
+ echomsg 'clipboard: error invoking '.get(self.argv, 0, '?').': '.join(stderr)
+ echohl None
+ endif
+ call provider#clear_stderr(a:jobid)
endfunction
let s:selections = { '*': s:selection, '+': copy(s:selection)}
diff --git a/runtime/autoload/provider/pythonx.vim b/runtime/autoload/provider/pythonx.vim
index 2f64c22c71..7285ed43ea 100644
--- a/runtime/autoload/provider/pythonx.vim
+++ b/runtime/autoload/provider/pythonx.vim
@@ -5,17 +5,7 @@ endif
let s:loaded_pythonx_provider = 1
-let s:stderr = {}
-let s:job_opts = {'rpc': v:true}
-
-" TODO(bfredl): this logic is common and should be builtin
-function! s:job_opts.on_stderr(chan_id, data, event)
- let stderr = get(s:stderr, a:chan_id, [''])
- let last = remove(stderr, -1)
- let a:data[0] = last.a:data[0]
- call extend(stderr, a:data)
- let s:stderr[a:chan_id] = stderr
-endfunction
+let s:job_opts = {'rpc': v:true, 'on_stderr': function('provider#stderr_collector')}
function! provider#pythonx#Require(host) abort
let ver = (a:host.orig_name ==# 'python') ? 2 : 3
@@ -38,9 +28,11 @@ function! provider#pythonx#Require(host) abort
catch
echomsg v:throwpoint
echomsg v:exception
- for row in get(s:stderr, channel_id, [])
+ for row in provider#get_stderr(channel_id)
echomsg row
endfor
+ finally
+ call provider#clear_stderr(channel_id)
endtry
throw remote#host#LoadErrorForHost(a:host.orig_name,
\ '$NVIM_PYTHON_LOG_FILE')
diff --git a/runtime/doc/digraph.txt b/runtime/doc/digraph.txt
index 89351c5b4f..43f8ccab06 100644
--- a/runtime/doc/digraph.txt
+++ b/runtime/doc/digraph.txt
@@ -143,7 +143,7 @@ a standard meaning:
Two 2 Hook
Nine 9 Horn
- Equals = Cyrillic (= used as second char)
+ Equals = Cyrillic (= used as second char)
Asterisk * Greek
Percent sign % Greek/Cyrillic special
Plus + smalls: Arabic, capitals: Hebrew
@@ -922,6 +922,7 @@ char digraph hex dec official name ~
† /- 2020 8224 DAGGER
‡ /= 2021 8225 DOUBLE DAGGER
‥ .. 2025 8229 TWO DOT LEADER
+… ,. 2026 8230 HORIZONTAL ELLIPSIS
‰ %0 2030 8240 PER MILLE SIGN
′ 1' 2032 8242 PRIME
″ 2' 2033 8243 DOUBLE PRIME
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 8882043162..3e75a42a62 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -4046,7 +4046,9 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()*
locale locale names (as output of locale -a)
mapping mapping name
menu menus
+ messages |:messages| suboptions
option options
+ packadd optional package |pack-add| names
shellcmd Shell command
sign |:sign| suboptions
syntax syntax file names |'syntax'|
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index bfcf621cb8..944f7474be 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -1202,6 +1202,7 @@ completion can be enabled:
-complete=locale locale names (as output of locale -a)
-complete=mapping mapping name
-complete=menu menus
+ -complete=messages |:messages| suboptions
-complete=option options
-complete=packadd optional package |pack-add| names
-complete=shellcmd Shell command