aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake.deps/cmake/BuildLpeg.cmake16
-rw-r--r--runtime/doc/lua.txt2
-rw-r--r--runtime/lua/vim/highlight.lua14
-rw-r--r--snap/snapcraft.yaml85
4 files changed, 23 insertions, 94 deletions
diff --git a/cmake.deps/cmake/BuildLpeg.cmake b/cmake.deps/cmake/BuildLpeg.cmake
index 81efccf1f4..bbdc83d94d 100644
--- a/cmake.deps/cmake/BuildLpeg.cmake
+++ b/cmake.deps/cmake/BuildLpeg.cmake
@@ -1,4 +1,18 @@
-list(APPEND LPEG_CMAKE_ARGS "-DCMAKE_C_FLAGS:STRING=${DEPS_INCLUDE_FLAGS}")
+set(LPEG_INCLUDE_FLAGS ${DEPS_INCLUDE_FLAGS})
+
+if(NOT USE_BUNDLED_LUAJIT AND NOT USE_BUNDLED_LUA)
+ find_package(Luajit)
+ if(LUAJIT_FOUND)
+ string(CONCAT LPEG_INCLUDE_FLAGS ${DEPS_INCLUDE_FLAGS} " -I${LUAJIT_INCLUDE_DIR}")
+ else()
+ find_package(Lua 5.1 EXACT)
+ if(LUA_FOUND)
+ string(CONCAT LPEG_INCLUDE_FLAGS ${DEPS_INCLUDE_FLAGS} " -I${LUA_INCLUDE_DIR}")
+ endif()
+ endif()
+endif()
+
+list(APPEND LPEG_CMAKE_ARGS -DCMAKE_C_FLAGS=${LPEG_INCLUDE_FLAGS})
ExternalProject_Add(lpeg
URL ${LPEG_URL}
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 820bd0eb35..d9952205da 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -592,6 +592,8 @@ vim.highlight.on_yank({opts}) *vim.highlight.on_yank()*
- {on_macro} highlight when executing macro (default `false`)
- {on_visual} highlight when yanking visual selection (default `true`)
- {event} event structure (default |v:event|)
+ - {priority} priority of highlight (default |vim.highlight.priorities|`.user`)
+
vim.highlight.range({bufnr}, {ns}, {hlgroup}, {start}, {finish}, {opts})
*vim.highlight.range()*
diff --git a/runtime/lua/vim/highlight.lua b/runtime/lua/vim/highlight.lua
index a6cfcb730f..86e1adb49e 100644
--- a/runtime/lua/vim/highlight.lua
+++ b/runtime/lua/vim/highlight.lua
@@ -61,6 +61,7 @@ local yank_timer
-- - on_macro highlight when executing macro (default false)
-- - on_visual highlight when yanking visual selection (default true)
-- - event event structure (default vim.v.event)
+-- - priority integer priority (default |vim.highlight.priorities|`.user`)
function M.on_yank(opts)
vim.validate({
opts = {
@@ -99,14 +100,11 @@ function M.on_yank(opts)
yank_timer:close()
end
- M.range(
- bufnr,
- yank_ns,
- higroup,
- "'[",
- "']",
- { regtype = event.regtype, inclusive = event.inclusive, priority = M.priorities.user }
- )
+ M.range(bufnr, yank_ns, higroup, "'[", "']", {
+ regtype = event.regtype,
+ inclusive = event.inclusive,
+ priority = opts.priority or M.priorities.user,
+ })
yank_timer = vim.defer_fn(function()
yank_timer = nil
diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
deleted file mode 100644
index 74ccc49886..0000000000
--- a/snap/snapcraft.yaml
+++ /dev/null
@@ -1,85 +0,0 @@
-name: nvim
-base: core18
-adopt-info: nvim
-summary: Vim-fork focused on extensibility and agility.
-description: |
- Neovim is a project that seeks to aggressively refactor Vim in order to:
-
- Simplify maintenance and encourage contributions
- Split the work between multiple developers
- Enable the implementation of new/modern user interfaces without any modifications to the core source
- Improve extensibility with a new plugin architecture
- For lots more details, see the wiki!
-
-grade: stable # must be 'stable' to release into candidate/stable channels
-confinement: classic
-
-apps:
- nvim:
- command: usr/bin/nvim
- environment:
- HOME: /home/$USER
- VIM: $SNAP/usr/share/nvim
- VIMRUNTIME: $SNAP/usr/share/nvim/runtime
- desktop: usr/share/applications/nvim.desktop
-
-parts:
- nvim:
- source: https://github.com/neovim/neovim.git
- override-pull: |
- snapcraftctl pull
- latest_tag="$(git tag -l --sort=refname|head -1)"
- git checkout "${latest_tag}"
- major="$(awk '/NVIM_VERSION_MAJOR/{gsub(")","",$2); print $2}' CMakeLists.txt)"
- minor="$(awk '/NVIM_VERSION_MINOR/{gsub(")","",$2); print $2}' CMakeLists.txt)"
- patch="$(awk '/NVIM_VERSION_PATCH/{gsub(")","",$2); print $2}' CMakeLists.txt)"
- version_prefix="v$major.$minor.$patch"
- git_described="$(git describe --first-parent --dirty 2> /dev/null | perl -lpe 's/v\d.\d.\d-//g')"
- git_described="${git_described:-$(git describe --first-parent --tags --always --dirty)}"
- if [ "${version_prefix}" != "${git_described}" ]; then
- VERSION="${version_prefix}-${git_described}-${latest_tag}"
- else
- VERSION="${version_prefix}-${latest_tag}"
- fi
- snapcraftctl set-version "${VERSION}"
- plugin: make
- make-parameters:
- - CMAKE_BUILD_TYPE=RelWithDebInfo
- - CMAKE_INSTALL_PREFIX=/usr
- - CMAKE_FLAGS=-DPREFER_LUA=ON
- - DEPS_CMAKE_FLAGS="-DUSE_BUNDLED_LUA=ON -DUSE_BUNDLED_LUAJIT=OFF"
- override-build: |
- echo "Building on $SNAP_ARCH"
- set -x
- case "$SNAP_ARCH" in
- "arm64" | "ppc64el" | "s390x")
- make -j"${SNAPCRAFT_PARALLEL_BUILD_COUNT}" \
- CMAKE_BUILD_TYPE=RelWithDebInfo \
- CMAKE_INSTALL_PREFIX=/usr \
- CMAKE_FLAGS=-DPREFER_LUA=ON \
- DEPS_CMAKE_FLAGS="-DUSE_BUNDLED_LUA=ON -DUSE_BUNDLED_LUAJIT=OFF"
- ;;
- *)
- make -j"${SNAPCRAFT_PARALLEL_BUILD_COUNT}" \
- CMAKE_BUILD_TYPE=RelWithDebInfo \
- CMAKE_INSTALL_PREFIX=/usr
- ;;
- esac
- make DESTDIR="$SNAPCRAFT_PART_INSTALL" install
- # Fix Desktop file
- sed -i 's|^Exec=nvim|Exec=/snap/bin/nvim.nvim|' ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/nvim.desktop
- sed -i 's|^TryExec=nvim|TryExec=/snap/bin/nvim.nvim|' ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/nvim.desktop
- sed -i 's|^Icon=.*|Icon=${SNAP}/usr/share/icons/hicolor/128x128/apps/nvim.png|' ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/nvim.desktop
- build-packages:
- - ninja-build
- - cmake
- - gawk
- - g++
- - git
- - gettext
- - pkg-config
- - unzip
- - wget
- prime:
- - -usr/share/man
-