-
Notifications
You must be signed in to change notification settings - Fork 442
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into slack-theme
- Loading branch information
Showing
196 changed files
with
8,271 additions
and
5,963 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
".": "4.1.3" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
core: | ||
- all: | ||
- changed-files: | ||
- any-glob-to-any-file: "lua/tokyonight/**" | ||
- all-globs-to-all-files: | ||
- "!lua/tokyonight/groups/**" | ||
- "!lua/tokyonight/colors/**" | ||
- "!lua/tokyonight/extra/**" | ||
|
||
extras: | ||
- changed-files: | ||
- any-glob-to-any-file: "lua/tokyonight/extra/**" | ||
|
||
groups: | ||
- changed-files: | ||
- any-glob-to-any-file: "lua/tokyonight/groups/**" | ||
|
||
base: | ||
- changed-files: | ||
- any-glob-to-any-file: | ||
- "lua/tokyonight/groups/base.lua" | ||
- "lua/tokyonight/groups/kinds.lua" | ||
- "lua/tokyonight/groups/treesitter.lua" | ||
- "lua/tokyonight/groups/semantic_tokens.lua" | ||
|
||
colors: | ||
- changed-files: | ||
- any-glob-to-any-file: "lua/tokyonight/colors/**" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", | ||
"packages": { | ||
".": { | ||
"release-type": "simple", | ||
"extra-files": ["lua/tokyonight/config.lua"] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: "Pull Request Labeler" | ||
on: | ||
- pull_request_target | ||
|
||
jobs: | ||
labeler: | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/labeler@v5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: "Lint PR" | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
|
||
permissions: | ||
pull-requests: read | ||
|
||
jobs: | ||
main: | ||
name: Validate PR title | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
requireScope: true | ||
subjectPattern: ^(?![A-Z]).+$ | ||
scopes: | | ||
.+ | ||
types: | | ||
build | ||
chore | ||
ci | ||
docs | ||
feat | ||
fix | ||
merge | ||
perf | ||
refactor | ||
revert | ||
style | ||
test | ||
wip | ||
ignoreLabels: | | ||
autorelease: pending |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
tt.* | ||
.tests | ||
.docs | ||
doc/tags | ||
debug | ||
.repro | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
--# selene: allow(global_usage) | ||
--# selene: allow(mixed_table) | ||
|
||
local Util = require("tokyonight.util") | ||
|
||
local colors ---@type ColorScheme | ||
local cache = {} ---@type table<string,table<string,string>> | ||
local hl_groups = {} ---@type table<string,boolean> | ||
|
||
---@param hl tokyonight.Highlight|string | ||
local function get_hl_group(hl) | ||
local group = "TokyonightDev" .. vim.inspect(hl):gsub("%W+", "_") | ||
if not hl_groups[group] then | ||
hl = type(hl) == "string" and { link = hl } or hl | ||
hl = vim.deepcopy(hl, true) | ||
Util.resolve({ foo = hl }) | ||
hl.fg = hl.fg or colors.fg | ||
vim.api.nvim_set_hl(0, group, hl) | ||
hl_groups[group] = true | ||
end | ||
return group | ||
end | ||
|
||
local function get_group(buf) | ||
local fname = vim.api.nvim_buf_get_name(buf or 0) | ||
fname = vim.fs.normalize(fname) | ||
if not fname:find("lua/tokyonight/groups") then | ||
return | ||
end | ||
return vim.fn.fnamemodify(fname, ":t:r") | ||
end | ||
|
||
local function load(group) | ||
if cache[group] then | ||
return | ||
end | ||
cache[group] = {} | ||
local opts | ||
colors, opts = require("tokyonight.colors").setup(opts) | ||
local highlights = require("tokyonight.groups").get(group, colors, opts) | ||
for k, v in pairs(highlights) do | ||
cache[group][k] = get_hl_group(v) | ||
end | ||
end | ||
|
||
vim.api.nvim_create_autocmd("BufWritePost", { | ||
group = vim.api.nvim_create_augroup("tokyonight_dev", { clear = true }), | ||
pattern = "*/lua/tokyonight/**.lua", | ||
callback = vim.schedule_wrap(function(ev) | ||
local opts = require("tokyonight.config").options | ||
for k in pairs(package.loaded) do | ||
if k:find("^tokyonight") then | ||
package.loaded[k] = nil | ||
end | ||
end | ||
require("tokyonight").setup(opts) | ||
require("tokyonight.util").cache.clear() | ||
vim.cmd.colorscheme(vim.g.colors_name) | ||
hl_groups = {} | ||
local hi = require("mini.hipatterns") | ||
local group = get_group(ev.buf) | ||
if group then | ||
cache[group] = nil | ||
end | ||
for _, buf in ipairs(hi.get_enabled_buffers()) do | ||
hi.update(buf) | ||
end | ||
end), | ||
}) | ||
|
||
return { | ||
{ | ||
"echasnovski/mini.hipatterns", | ||
opts = function(_, opts) | ||
opts.highlighters = opts.highlighters or {} | ||
opts.highlighters.tokyonight = { | ||
pattern = function(buf) | ||
local group = get_group(buf) | ||
if not group or group == "init" then | ||
return | ||
end | ||
load(group) | ||
return group and '^%s*%[?"?()[%w%.@]+()"?%]?%s*=' | ||
end, | ||
group = function(buf, match, data) | ||
local name = get_group(buf) | ||
if name == "kinds" then | ||
match = "LspKind" .. match | ||
end | ||
return name and cache[name][match] | ||
end, | ||
extmark_opts = { priority = 2000 }, | ||
} | ||
|
||
opts.highlighters.tokyonight_colors = { | ||
pattern = { | ||
"%f[%w]()c%.[%w_%.]+()%f[%W]", | ||
"%f[%w]()colors%.[%w_%.]+()%f[%W]", | ||
"%f[%w]()vim%.g%.terminal_color_%d+()%f[%W]", | ||
}, | ||
group = function(_, match) | ||
local parts = vim.split(match, ".", { plain = true }) | ||
local t = _G --[[@as table]] | ||
if parts[1]:sub(1, 1) == "c" then | ||
table.remove(parts, 1) | ||
colors = colors or require("tokyonight.colors").setup() | ||
t = colors | ||
end | ||
local color = vim.tbl_get(t, unpack(parts)) | ||
return type(color) == "string" and get_hl_group({ fg = color }) | ||
end, | ||
extmark_opts = function(_, _, data) | ||
return { | ||
virt_text = { { "⬤ ", data.hl_group } }, | ||
virt_text_pos = "inline", | ||
priority = 2000, | ||
} | ||
end, | ||
} | ||
end, | ||
}, | ||
} |
Oops, something went wrong.