diff options
-rw-r--r-- | .travis.yml | 43 | ||||
-rwxr-xr-x | ci/snap/after_success.sh | 14 | ||||
-rwxr-xr-x | ci/snap/deploy.sh | 21 | ||||
-rwxr-xr-x | ci/snap/install.sh | 10 | ||||
-rwxr-xr-x | ci/snap/script.sh | 8 | ||||
-rw-r--r-- | ci/snap/travis_snapcraft.cfg | bin | 0 -> 2448 bytes | |||
-rw-r--r-- | runtime/ftplugin/man.vim | 1 | ||||
-rw-r--r-- | snap/snapcraft.yaml | 43 | ||||
-rw-r--r-- | src/nvim/screen.c | 9 | ||||
-rw-r--r-- | test/functional/terminal/buffer_spec.lua | 17 | ||||
-rw-r--r-- | third-party/CMakeLists.txt | 4 |
11 files changed, 153 insertions, 17 deletions
diff --git a/.travis.yml b/.travis.yml index d8a1d2ddf0..e4ced8ceb5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,19 @@ language: c env: global: + # Encrypted environment variables, see + # http://docs.travis-ci.com/user/encryption-keys/ + # + # SNAP_SECRET_KEY: generated by: + # travis encrypt SNAP_SECRET_KEY=xx --add + # https://github.com/neovim/neovim/pull/11428 + # snapcraft key expires after 1 year. Steps to refresh it: + # 1. snapcraft enable-ci travis --refresh + # 2. mv .snapcraft/travis_snapcraft.cfg ci/snap/travis_snapcraft.cfg + # 3. Copy after_success command to ci/snap/deploy.sh from .travis.yml + # 4. Undo changes to .travis.yml + - secure: hd0qn2u8ABbJg5Bx4pBRcUQbKYFmcSHoecyHIPTCnGJT+NI41Bvm/IkN/N5DhBF+LbD3Q2nmR/dzI5H/dqS7RxMFvEx1DuFLendFHHX3MYf0AuKpXYY3gwgMTmqx8p/v6srlU7RBGWNGzHCWqksAem+EIWCe3I7WvfdKo1/DV/Y= + # Set "false" to force rebuild of third-party dependencies. - CACHE_ENABLE=true # Build directory for Neovim. @@ -145,6 +158,36 @@ jobs: env: - CLANG_SANITIZER=TSAN - *common-job-env + - if: type != pull_request + name: snap + os: linux + env: + - LC_ALL: C.UTF-8 + - LANG: C.UTF-8 + - SNAPCRAFT_ENABLE_SILENT_REPORT: y + - SNAPCRAFT_ENABLE_DEVELOPER_DEBUG: y + addons: + snaps: + - name: snapcraft + channel: stable + classic: true + - name: http + - name: transfer + - name: lxd + channel: stable + # Override default before_install, before_cache. + before_install: /bin/true + before_cache: /bin/true + install: ci/snap/install.sh + before_script: echo "Building snap..." + script: ci/snap/script.sh + after_success: ci/snap/after_success.sh + deploy: + skip_cleanup: true + provider: script + script: ci/snap/deploy.sh + on: + branch: master fast_finish: true before_install: ci/before_install.sh diff --git a/ci/snap/after_success.sh b/ci/snap/after_success.sh new file mode 100755 index 0000000000..e66721a5e2 --- /dev/null +++ b/ci/snap/after_success.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail + + +RESULT_SNAP=$(find ./ -name "*.snap") + +sudo snap install "$RESULT_SNAP" --dangerous --classic + +/snap/bin/nvim --version + +SHA256=$(sha256sum "$RESULT_SNAP") +echo "SHA256: ${SHA256} ." diff --git a/ci/snap/deploy.sh b/ci/snap/deploy.sh new file mode 100755 index 0000000000..5fbd52d775 --- /dev/null +++ b/ci/snap/deploy.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail + +# not a tagged release, abort +# [[ "$TRAVIS_TAG" != "$TRAVIS_BRANCH" ]] && exit 0 + +mkdir -p .snapcraft +# shellcheck disable=SC2154 +openssl aes-256-cbc -K "$encrypted_ece1c4844832_key" -iv "$encrypted_ece1c4844832_iv" \ + -in ci/snap/travis_snapcraft.cfg -out .snapcraft/snapcraft.cfg -d + +SNAP=$(find ./ -name "*.snap") + +# TODO(justinmk): This always does `edge` until we enable tagged builds. +if [[ "$SNAP" =~ "dirty" || "$SNAP" =~ "nightly" ]]; then + snapcraft push "$SNAP" --release edge +else + snapcraft push "$SNAP" --release candidate +fi diff --git a/ci/snap/install.sh b/ci/snap/install.sh new file mode 100755 index 0000000000..23e0bc5eb8 --- /dev/null +++ b/ci/snap/install.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail + +sudo apt update +sudo /snap/bin/lxd.migrate -yes +sudo /snap/bin/lxd waitready +sudo /snap/bin/lxd init --auto + diff --git a/ci/snap/script.sh b/ci/snap/script.sh new file mode 100755 index 0000000000..647cda4874 --- /dev/null +++ b/ci/snap/script.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail + +mkdir -p "$TRAVIS_BUILD_DIR/snaps-cache" +sudo snapcraft --use-lxd + diff --git a/ci/snap/travis_snapcraft.cfg b/ci/snap/travis_snapcraft.cfg Binary files differnew file mode 100644 index 0000000000..3e6a60c30d --- /dev/null +++ b/ci/snap/travis_snapcraft.cfg diff --git a/runtime/ftplugin/man.vim b/runtime/ftplugin/man.vim index 7c535dc839..081181cfe9 100644 --- a/runtime/ftplugin/man.vim +++ b/runtime/ftplugin/man.vim @@ -26,7 +26,6 @@ if !exists('g:no_plugin_maps') && !exists('g:no_man_maps') nnoremap <silent> <buffer> j gj nnoremap <silent> <buffer> k gk nnoremap <silent> <buffer> gO :call man#show_toc()<CR> - nnoremap <silent> <buffer> K :Man<CR> if 1 == bufnr('%') || s:pager nnoremap <silent> <buffer> <nowait> q :lclose<CR>:q<CR> else diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 81ffb9adf3..da3e74d3e7 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,5 +1,6 @@ -name: neovim -version: git +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: @@ -9,22 +10,41 @@ description: | 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: - neovim: - command: usr/local/bin/nvim - plugs: [network, network-bind, x11] + nvim: + command: usr/bin/nvim environment: HOME: /home/$USER - VIM: $SNAP/usr/local/share/nvim/runtime + VIM: $SNAP/usr/share/nvim + VIMRUNTIME: $SNAP/usr/share/nvim/runtime + desktop: usr/share/applications/nvim.desktop parts: - neovim: + nvim: source: . + override-pull: | + snapcraftctl pull + 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)}" + snapcraftctl set-version "${version_prefix}-${git_described}" plugin: make make-parameters: - CMAKE_BUILD_TYPE=Release + - CMAKE_INSTALL_PREFIX=/usr + override-build: | + snapcraftctl build + # 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/pixmaps/nvim.png|' ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/nvim.desktop build-packages: - ninja-build - libtool @@ -33,9 +53,10 @@ parts: - automake - cmake - g++ + - git + - gettext - pkg-config - unzip - snap: - - usr/local/bin - - usr/local/share/nvim - - -usr/local/share/man + prime: + - -usr/share/man + diff --git a/src/nvim/screen.c b/src/nvim/screen.c index e9be7eed38..1d29ae064e 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -4021,10 +4021,13 @@ win_line ( if (wp->w_buffer->terminal) { // terminal buffers may need to highlight beyond the end of the // logical line - while (col < grid->Columns) { + int n = wp->w_p_rl ? -1 : 1; + while (col >= 0 && col < grid->Columns) { schar_from_ascii(linebuf_char[off], ' '); - linebuf_attr[off++] = term_attrs[vcol++]; - col++; + linebuf_attr[off] = term_attrs[vcol]; + off += n; + vcol += n; + col += n; } } grid_put_linebuf(grid, row, 0, col, grid->Columns, wp->w_p_rl, wp, diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua index 7560b0e872..2fc7a021cb 100644 --- a/test/functional/terminal/buffer_spec.lua +++ b/test/functional/terminal/buffer_spec.lua @@ -5,6 +5,7 @@ local wait = helpers.wait local eval, feed_command, source = helpers.eval, helpers.feed_command, helpers.source local eq, neq = helpers.eq, helpers.neq local write_file = helpers.write_file +local command= helpers.command describe(':terminal buffer', function() local screen @@ -224,6 +225,22 @@ describe(':terminal buffer', function() neq('terminal', eval('&buftype')) end) end) + + it('it works with set rightleft #11438', function() + local columns = eval('&columns') + feed(string.rep('a', columns)) + command('set rightleft') + screen:expect([[ + ydaer ytt| + {1:a}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + | + | + | + | + {3:-- TERMINAL --} | + ]]) + command('bdelete!') + end) end) describe('No heap-buffer-overflow when using', function() diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt index 7465d037ee..90ec475894 100644 --- a/third-party/CMakeLists.txt +++ b/third-party/CMakeLists.txt @@ -159,8 +159,8 @@ set(LUAROCKS_SHA256 0cab9f79311083f33e4d8f5a76021604f1d3f7141ce9a2ef1d8b717d9205 set(UNIBILIUM_URL https://github.com/neovim/unibilium/archive/92d929f.tar.gz) set(UNIBILIUM_SHA256 29815283c654277ef77a3adcc8840db79ddbb20a0f0b0c8f648bd8cd49a02e4b) -set(LIBTERMKEY_URL http://www.leonerd.org.uk/code/libtermkey/libtermkey-0.21.1.tar.gz) -set(LIBTERMKEY_SHA256 cecbf737f35d18f433c8d7864f63c0f878af41f8bd0255a3ebb16010dc044d5f) +set(LIBTERMKEY_URL http://www.leonerd.org.uk/code/libtermkey/libtermkey-0.22.tar.gz) +set(LIBTERMKEY_SHA256 6945bd3c4aaa83da83d80a045c5563da4edd7d0374c62c0d35aec09eb3014600) set(LIBVTERM_URL https://github.com/neovim/libvterm/archive/7c72294d84ce20da4c27362dbd7fa4b08cfc91da.tar.gz) set(LIBVTERM_SHA256 f30c4d43e0c6db3e0912daf7188d98fbf6ee88f97589d72f6f304e5db48826a8) |