Compare commits
2 commits
0.x
...
refactor/1
| Author | SHA1 | Date | |
|---|---|---|---|
| 483106ae25 | |||
| b069be83f5 |
5 changed files with 26 additions and 13 deletions
23
.github/workflows/ci.yml
vendored
23
.github/workflows/ci.yml
vendored
|
|
@ -10,7 +10,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 1000
|
fetch-depth: 1000
|
||||||
|
|
||||||
|
|
@ -24,7 +24,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install luarocks
|
- name: Install luarocks
|
||||||
run: sudo apt update && sudo apt install -y luarocks
|
run: sudo apt update && sudo apt install -y luarocks
|
||||||
|
|
@ -35,12 +35,25 @@ jobs:
|
||||||
- name: Run luacheck
|
- name: Run luacheck
|
||||||
run: luacheck .
|
run: luacheck .
|
||||||
|
|
||||||
|
stylua:
|
||||||
|
name: StyLua
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Run stylua
|
||||||
|
uses: JohnnyMorganz/stylua-action@1.0.0
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
args: --check .
|
||||||
|
|
||||||
clang-format:
|
clang-format:
|
||||||
name: Clang Format
|
name: Clang Format
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y clang-format findutils
|
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y clang-format findutils
|
||||||
|
|
@ -53,7 +66,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Run cargo format
|
- name: Run cargo format
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
|
|
@ -66,7 +79,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install rust toolchain
|
- name: Install rust toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ controller.run = function(name, items, callback)
|
||||||
|
|
||||||
window.initialize()
|
window.initialize()
|
||||||
|
|
||||||
window.set_items { { content = "-- Loading ---" } }
|
window.set_items { { content = "-- Loading ---" } }
|
||||||
vim.api.nvim_buf_set_name(window.get_buffer(), name)
|
vim.api.nvim_buf_set_name(window.get_buffer(), name)
|
||||||
|
|
||||||
controller.input ""
|
controller.input ""
|
||||||
|
|
@ -31,7 +31,7 @@ end
|
||||||
controller.update = function(text)
|
controller.update = function(text)
|
||||||
vim.schedule(function()
|
vim.schedule(function()
|
||||||
window.set_items(controller.items(text))
|
window.set_items(controller.items(text))
|
||||||
vim.cmd("syntax clear IvyMatch")
|
vim.cmd "syntax clear IvyMatch"
|
||||||
vim.cmd("syntax match IvyMatch '[(" .. text .. ")]'")
|
vim.cmd("syntax match IvyMatch '[(" .. text .. ")]'")
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ libivy.ivy_init = function(dir)
|
||||||
ivy_c.ivy_init(dir)
|
ivy_c.ivy_init(dir)
|
||||||
end
|
end
|
||||||
|
|
||||||
libivy.ivy_cwd = function ()
|
libivy.ivy_cwd = function()
|
||||||
return ffi.string(ivy_c.ivy_cwd())
|
return ffi.string(ivy_c.ivy_cwd())
|
||||||
end
|
end
|
||||||
|
|
||||||
libivy.ivy_match = function(pattern, text)
|
libivy.ivy_match = function(pattern, text)
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,11 @@ it("should run a simple match", function(t)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it("should find a dot file", function (t)
|
it("should find a dot file", function(t)
|
||||||
local current_dir = libivy.ivy_cwd()
|
local current_dir = libivy.ivy_cwd()
|
||||||
local matches = libivy.ivy_files("ci.yml", current_dir);
|
local matches = libivy.ivy_files("ci.yml", current_dir)
|
||||||
|
|
||||||
if matches ~= ".github/workflows/ci.yml\n" then
|
if matches ~= ".github/workflows/ci.yml\n" then
|
||||||
t.error("Invalid matches: " .. matches)
|
t.error("Invalid matches: " .. matches)
|
||||||
end
|
end
|
||||||
end);
|
end)
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ window.set_items = function(items)
|
||||||
|
|
||||||
-- Display no items text if there are no items to dispaly
|
-- Display no items text if there are no items to dispaly
|
||||||
if #items == 0 then
|
if #items == 0 then
|
||||||
items = { { content = "-- No Items --" } }
|
items = { { content = "-- No Items --" } }
|
||||||
end
|
end
|
||||||
|
|
||||||
local items_length = #items
|
local items_length = #items
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue