Skip to content

Commit

Permalink
Require nvim v0.10
Browse files Browse the repository at this point in the history
  • Loading branch information
ObserverOfTime committed May 17, 2024
1 parent de699dc commit ccbf364
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 46 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/panvimdoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@ name: Generate docs

on:
push:
branches: [master]
branches: ["*"]
paths:
- README.md
- .github/workflows/panvimdoc.yml

jobs:
panvimdoc:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: kdheepak/panvimdoc@v3.0.6
- uses: actions/checkout@v4
- uses: kdheepak/panvimdoc@v4.0.1
with:
vimdoc: nvimcord
version: NVIM v0.9.0
version: NVIM v0.10.0
treesitter: true
- uses: stefanzweifel/git-auto-commit-action@v4
shiftheadinglevelby: -1
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Auto generate docs
75 changes: 43 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,48 +10,59 @@ A Discord Rich Presence plugin for Neovim written in Lua.

## Installation

### packer
### lazy.nvim

```lua
use 'ObserverOfTime/nvimcord'
```

### plug

```vim
Plug 'ObserverOfTime/nvimcord'
{
'ObserverOfTime/nvimcord',
opts = {
...
}
}
```

### dein
### pckr.nvim

```vim
call dein#add('ObserverOfTime/nvimcord')
```lua
{
'ObserverOfTime/nvimcord',
config = function()
require('nvimcord').setup {
...
}
end
}
```

## Configuration

These are the default values:

```lua
-- NOTE: these are the defaults
require('nvimcord').setup {
-- Start the RPC manually (boolean)
autostart = false,
-- Set the client ID (string)
client_id = '954365489214291979',
-- Update workspace on chdir (boolean)
dynamic_workspace = false,
-- Use the filetype as the large icon (boolean)
large_file_icon = true,
-- Set the log level (enum)
log_level = vim.log.levels.INFO,
-- Get the workspace name (function|string)
workspace_name = function()
return --[[git root or cwd basename]]
end,
-- Get the workspace URL (function|string)
workspace_url = function()
return --[[git remote URL]]
end
}
-- Start the RPC manually (boolean)
autostart = false

-- Set the client ID (string)
client_id = '954365489214291979'

-- Update workspace on chdir (boolean)
dynamic_workspace = false

-- Use the filetype as the large icon (boolean)
large_file_icon = true

-- Set the log level (vim.log.levels.*)
log_level = vim.log.levels.INFO

-- Get the workspace name (function|string)
workspace_name = function()
return --[[git root or cwd basename]]
end

-- Get the workspace URL (function|string)
workspace_url = function()
return --[[git remote URL]]
end
```

Options can also be configured using Vim variables.
Expand Down
4 changes: 2 additions & 2 deletions lua/nvimcord.lua
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ end

---@param opts? nvimcord.Config
local function setup(opts)
if vim.version().minor < 9 then
if vim.version().minor < 10 then
local log = require('nvimcord.util').log
log('nvim v0.9 is required', 'ERROR', 0)
log('nvim v0.10 is required', 'ERROR', 0)
return
end

Expand Down
4 changes: 1 addition & 3 deletions lua/nvimcord/discord.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ function Discord:init(config)
self.authenticated = false
self.pid = assert(vim.uv.os_getpid())
self.timer = assert(vim.uv.new_timer())
-- TODO: 'v'..tostring(vim.version())
local version = assert(vim.fn.execute('version'))
self.version = vim.fn.split(version, '\n')[1]:sub(6)
self.version = ('v%s'):format(vim.version())
end

---@param lvl nvimcord.log_level
Expand Down
4 changes: 2 additions & 2 deletions lua/nvimcord/filetypes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -384,10 +384,10 @@ end

---@return string[]
function M.assets()
local fts = vim.tbl_flatten {
local fts = vim.iter({
vim.tbl_map(asset, vim.tbl_values(M.filetype)),
vim.tbl_map(asset, vim.tbl_values(M.pattern))
}
}):flatten():totable()
table.insert(fts, 'neovim')
table.insert(fts, 'unknown')
table.sort(fts)
Expand Down
4 changes: 2 additions & 2 deletions packspec.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"package": "nvimcord",
"version": "0.0.8",
"version": "0.0.9",
"packspec": "0.1.0",
"source": "git+ssh://github.com/ObserverOfTime/nvimcord.git",
"description": {
Expand All @@ -10,7 +10,7 @@
},
"dependencies": {
"neovim": {
"version": ">= 0.9.0",
"version": ">= 0.10.0",
"source": "git+https://github.com/neovim/neovim.git"
}
}
Expand Down

0 comments on commit ccbf364

Please sign in to comment.