Skip to content

Commit

Permalink
Merge pull request #34 from lambdalisue/fix-ci
Browse files Browse the repository at this point in the history
Fix CI and upgrade supported Vim version
  • Loading branch information
lambdalisue authored Nov 8, 2024
2 parents 4dec28b + 0b21e3f commit 2eb4384
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 54 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/neovim.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Neovim

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- windows-latest
- ubuntu-latest
version:
- stable
- v0.4.4
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: thinca/vim-themis
path: vim-themis
- uses: rhysd/action-setup-vim@v1
id: nvim
with:
neovim: true
version: "${{ matrix.version }}"
- name: Run tests
env:
THEMIS_VIM: ${{ steps.nvim.outputs.executable }}
# XXX:
# Overwrite %TMP% to point a correct temp directory.
# Note that %TMP% only affects value of 'tempname()' in Windows.
# https://github.jparrowsec.cnmunity/t5/GitHub-Actions/TEMP-is-broken-on-Windows/m-p/30432#M427
TMP: 'C:\Users\runneradmin\AppData\Local\Temp'
run: |
./vim-themis/bin/themis
45 changes: 0 additions & 45 deletions .github/workflows/test.yml

This file was deleted.

42 changes: 42 additions & 0 deletions .github/workflows/vim.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Vim

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
test:
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- windows-latest
- ubuntu-latest
version:
- nightly
- v8.2.5136 # https://github.com/lambdalisue/vim-fern/issues/506
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: thinca/vim-themis
path: vim-themis
- uses: rhysd/action-setup-vim@v1
id: vim
with:
version: "${{ matrix.version }}"
- name: Run tests
env:
THEMIS_VIM: ${{ steps.vim.outputs.executable }}
# XXX:
# Overwrite %TMP% to point a correct temp directory.
# Note that %TMP% only affects value of 'tempname()' in Windows.
# https://github.jparrowsec.cnmunity/t5/GitHub-Actions/TEMP-is-broken-on-Windows/m-p/30432#M427
TMP: 'C:\Users\runneradmin\AppData\Local\Temp'
run: |
./vim-themis/bin/themis
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 👓 nerdfont.vim

![Support Vim 8.1 or above](https://img.shields.io/badge/support-Vim%208.1%20or%20above-yellowgreen.svg)
![Support Neovim 0.4 or above](https://img.shields.io/badge/support-Neovim%200.4%20or%20above-yellowgreen.svg)
![Support Vim 8.2.5136 or above](https://img.shields.io/badge/support-Vim%208.2.5136%20or%20above-yellowgreen.svg)
![Support Neovim 0.4.4 or above](https://img.shields.io/badge/support-Neovim%200.4.4%20or%20above-yellowgreen.svg)
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![Doc](https://img.shields.io/badge/doc-%3Ah%20nerdfont-orange.svg)](doc/nerdfont.txt)

Expand Down
13 changes: 6 additions & 7 deletions autoload/nerdfont.vim
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
let s:path = fnamemodify(resolve(expand('<sfile>:p')), ':h:h')
let s:json_dir = s:path . '/assets/json'
let s:sep = has('win32') ? '\' : '/'
let s:json_dir = join([s:path, 'assets', 'json'], s:sep)

function! nerdfont#get_json(json_name) abort
let l:json = s:json_dir . '/' . a:json_name . '.json'
let l:json = join([s:json_dir, a:json_name . '.json'], s:sep)
let l:result = json_decode(join(readfile(l:json), ''))
call s:autofix(l:result)
return l:result
Expand Down Expand Up @@ -32,7 +33,9 @@ function! nerdfont#find(...) abort
return glyph
endif

return g:nerdfont#default
return exists('g:nerdfont#default')
\ ? g:nerdfont#default
\ : nerdfont#path#extension#defaults['.']
endfunction

function! s:autofix(result) abort
Expand All @@ -50,7 +53,3 @@ function! s:autofix(result) abort
endtry
endif
endfunction

let g:nerdfont#default = get(g:, 'nerdfont#default',
\ g:nerdfont#path#extension#defaults['.'])

0 comments on commit 2eb4384

Please sign in to comment.