diff options
-rw-r--r-- | .github/workflows/ci.yml | 6 | ||||
-rw-r--r-- | .github/workflows/release.yml (renamed from .github/workflows/nightly.yml) | 109 | ||||
-rw-r--r-- | src/nvim/message.c | 2 | ||||
-rw-r--r-- | src/nvim/window.c | 31 | ||||
-rw-r--r-- | test/functional/ui/multigrid_spec.lua | 71 |
5 files changed, 147 insertions, 72 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70cdc3b4a2..dcc3c2c45f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,9 @@ name: CI -on: [push, pull_request] +on: + push: + branches: '**' + pull_request: + branches: 'master' jobs: build: diff --git a/.github/workflows/nightly.yml b/.github/workflows/release.yml index f1b524921f..9fc7feca33 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,16 @@ -name: Nightly release +name: Release on: schedule: - cron: '5 5 * * *' + workflow_dispatch: + inputs: + tag_name: + description: 'Tag name for release' + required: false + default: nightly + push: + tags: + - v[0-9]+.[0-9]+.[0-9]+ jobs: linux: @@ -15,19 +24,19 @@ jobs: run: | sudo apt-get update sudo apt-get install -y autoconf automake build-essential cmake gcc-multilib gettext gperf libtool-bin locales ninja-build pkg-config unzip - - name: Build nightly + - name: Build release id: build run: | make CMAKE_BUILD_TYPE=RelWithDebinfo CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH=" printf '::set-output name=version::%s\n' "$(./build/bin/nvim --version | head -n 3 | sed -z 's/\n/%0A/g')" printf '::set-output name=release::%s\n' "$(./build/bin/nvim --version | head -n 1 | sed 's/-.*//')" - make DESTDIR="$GITHUB_WORKSPACE/build/nightly/nvim-linux64" install - cd "$GITHUB_WORKSPACE/build/nightly" + make DESTDIR="$GITHUB_WORKSPACE/build/release/nvim-linux64" install + cd "$GITHUB_WORKSPACE/build/release" tar cfz nvim-linux64.tar.gz nvim-linux64 - uses: actions/upload-artifact@v2 with: - name: nvim-linux64.tar.gz - path: build/nightly/nvim-linux64.tar.gz + name: nvim-linux64 + path: build/release/nvim-linux64.tar.gz retention-days: 1 appimage: @@ -39,17 +48,18 @@ jobs: run: | sudo apt-get update sudo apt-get install -y autoconf automake build-essential cmake gcc-multilib gettext gperf libtool-bin locales ninja-build pkg-config unzip - - name: Build appimage - run: | - make appimage-nightly + - if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly') + run: make appimage-latest + - if: github.event_name == 'scheduled' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly') + run: make appimage-nightly - uses: actions/upload-artifact@v2 with: - name: nvim.appimage + name: appimage path: build/bin/nvim.appimage retention-days: 1 - uses: actions/upload-artifact@v2 with: - name: nvim.appimage.zsync + name: appimage path: build/bin/nvim.appimage.zsync retention-days: 1 @@ -61,13 +71,13 @@ jobs: run: | brew update >/dev/null brew install automake ninja - - name: Build nightly + - name: Build release run: | make CMAKE_BUILD_TYPE=Release CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH= -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11" - make DESTDIR="$GITHUB_WORKSPACE/build/nightly/nvim-osx64" install + make DESTDIR="$GITHUB_WORKSPACE/build/release/nvim-osx64" install - name: Create package run: | - cd "$GITHUB_WORKSPACE/build/nightly" + cd "$GITHUB_WORKSPACE/build/release" mkdir -p bundle/nvim/libs mkdir -p bundle/nvim/bin cp nvim-osx64/bin/nvim bundle/nvim/bin/ @@ -86,8 +96,8 @@ jobs: tar cjSf nvim-macos.tar.bz2 -C bundle nvim - uses: actions/upload-artifact@v2 with: - name: nvim-macos.tar.bz2 - path: build/nightly/nvim-macos.tar.bz2 + name: nvim-macos + path: build/release/nvim-macos.tar.bz2 retention-days: 1 publish: @@ -95,16 +105,36 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/download-artifact@v2 - - uses: actions/create-release@v1 - id: create_release + - if: github.event_name == 'workflow_dispatch' + run: echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV + - if: github.event_name == 'scheduled' + run: echo 'TAG_NAME=nightly' >> $GITHUB_ENV + - if: github.event_name == 'push' + run: | + TAG_NAME=${{ github.ref }} + echo "TAG_NAME=${TAG_NAME#refs/tags/}" >> $GITHUB_ENV + - if: env.TAG_NAME == 'nightly' + run: echo 'SUBJECT=Nvim development (prerelease) build' >> $GITHUB_ENV + - if: env.TAG_NAME != 'nightly' + run: echo 'SUBJECT=Nvim release build' >> $GITHUB_ENV + - uses: meeDamian/github-release@2.0 with: - tag_name: nightly - release_name: NVIM ${{ needs.linux.outputs.release }} + token: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ env.TAG_NAME }} + name: ${{ needs.linux.outputs.release }} + prerelease: ${{ env.TAG_NAME == 'nightly' }} + commitish: ${{ github.sha }} + gzip: false + allow_override: ${{ env.TAG_NAME == 'nightly' }} + files: | + nvim-macos.tar.bz2:./nvim-macos/nvim-macos.tar.bz2 + nvim-linux64.tar.gz:./nvim-linux64/nvim-linux64.tar.gz + nvim.appimage:./appimage/nvim.appimage + nvim.appimage.zsync:./appimage/nvim.appimage.zsync body: | - Nvim development (prerelease) build. - ``` - ${{ needs.linux.outputs.version }} + ${{ env.SUBJECT }} ``` + ${{ needs.linux.outputs.version }}``` ## Install @@ -132,36 +162,3 @@ jobs: ### Other - Install by [package manager](https://github.com/neovim/neovim/wiki/Installing-Neovim) - prerelease: true - - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./nvim-macos.tar.bz2 - asset_name: nvim-macos.tar.bz2 - asset_content_type: application/x-bzip2 - - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./nvim-linux64.tar.gz - asset_name: nvim-linux64.tar.gz - asset_content_type: application/gzip - - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./nvim.appimage - asset_name: nvim.appimage - asset_content_type: application/x-executable - - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./nvim.appimage.zsync - asset_name: nvim.appimage.zsync - asset_content_type: application/octet-stream diff --git a/src/nvim/message.c b/src/nvim/message.c index ad38e6d060..02a7732f5c 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -1712,7 +1712,7 @@ void msg_prt_line(char_u *s, int list) col += utf_ptr2cells(s); char buf[MB_MAXBYTES + 1]; if (l >= MB_MAXBYTES) { - xstrlcpy(buf, "¿", sizeof(buf)); + xstrlcpy(buf, "?", sizeof(buf)); } else if (curwin->w_p_lcs_chars.nbsp != NUL && list && (utf_ptr2char(s) == 160 || utf_ptr2char(s) == 0x202f)) { diff --git a/src/nvim/window.c b/src/nvim/window.c index 72ee400e40..9eb16e67ec 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -3787,32 +3787,35 @@ void free_tabpage(tabpage_T *tp) /// @return Was the new tabpage created successfully? FAIL or OK. int win_new_tabpage(int after, char_u *filename) { - tabpage_T *tp = curtab; + tabpage_T *old_curtab = curtab; tabpage_T *newtp; int n; newtp = alloc_tabpage(); - /* Remember the current windows in this Tab page. */ - if (leave_tabpage(curbuf, TRUE) == FAIL) { + // Remember the current windows in this Tab page. + if (leave_tabpage(curbuf, true) == FAIL) { xfree(newtp); return FAIL; } - newtp->tp_localdir = tp->tp_localdir ? vim_strsave(tp->tp_localdir) : NULL; + newtp->tp_localdir = old_curtab->tp_localdir + ? vim_strsave(old_curtab->tp_localdir) : NULL; curtab = newtp; - /* Create a new empty window. */ - if (win_alloc_firstwin(tp->tp_curwin) == OK) { - /* Make the new Tab page the new topframe. */ + // Create a new empty window. + if (win_alloc_firstwin(old_curtab->tp_curwin) == OK) { + // Make the new Tab page the new topframe. if (after == 1) { - /* New tab page becomes the first one. */ + // New tab page becomes the first one. newtp->tp_next = first_tabpage; first_tabpage = newtp; } else { + tabpage_T *tp = old_curtab; + if (after > 0) { - /* Put new tab page before tab page "after". */ + // Put new tab page before tab page "after". n = 2; for (tp = first_tabpage; tp->tp_next != NULL && n < after; tp = tp->tp_next) @@ -3826,13 +3829,13 @@ int win_new_tabpage(int after, char_u *filename) win_comp_scroll(curwin); newtp->tp_topframe = topframe; - last_status(FALSE); + last_status(false); redraw_all_later(NOT_VALID); - tabpage_check_windows(tp); + tabpage_check_windows(old_curtab); - lastused_tabpage = tp; + lastused_tabpage = old_curtab; apply_autocmds(EVENT_WINNEW, NULL, NULL, false, curbuf); apply_autocmds(EVENT_WINENTER, NULL, NULL, false, curbuf); @@ -3842,8 +3845,8 @@ int win_new_tabpage(int after, char_u *filename) return OK; } - /* Failed, get back the previous Tab page */ - enter_tabpage(curtab, curbuf, TRUE, TRUE); + // Failed, get back the previous Tab page + enter_tabpage(curtab, curbuf, true, true); return FAIL; } diff --git a/test/functional/ui/multigrid_spec.lua b/test/functional/ui/multigrid_spec.lua index 6601c2d68e..719e2ee82a 100644 --- a/test/functional/ui/multigrid_spec.lua +++ b/test/functional/ui/multigrid_spec.lua @@ -1562,6 +1562,77 @@ describe('ext_multigrid', function() {1:~ }| ]]} + command('tabnext') + command('$tabnew') + screen:expect{grid=[[ + ## grid 1 + {16: }{17:2}{16: [No Name] }{17:2}{16: [No Name] }{7: [No Name] }{12: }{16:X}| + [7:-----------------------------------------------------]| + [7:-----------------------------------------------------]| + [7:-----------------------------------------------------]| + [7:-----------------------------------------------------]| + [7:-----------------------------------------------------]| + [7:-----------------------------------------------------]| + [7:-----------------------------------------------------]| + [7:-----------------------------------------------------]| + [7:-----------------------------------------------------]| + [7:-----------------------------------------------------]| + [7:-----------------------------------------------------]| + {11:[No Name] }| + [3:-----------------------------------------------------]| + ## grid 2 (hidden) + | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + ## grid 3 + | + ## grid 4 (hidden) + | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + ## grid 5 (hidden) + | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + ## grid 6 (hidden) + | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + ## grid 7 + ^ | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + ]]} + + command('tabclose') command('tabclose') screen:expect{grid=[[ ## grid 1 |