Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/rolling' into rolling
Browse files Browse the repository at this point in the history
* upstream/rolling:
  fix: copilot background should matcha statusline
  fix: disable gitsigns hunk navigation message (LunarVim#3244)
  chore(plugins): bump version (LunarVim#3248)
  perf(plugins): move assert `vim.env.LVIM_DEV_MODE` logic (LunarVim#3238)
  fix(nvim-cmp-lsp): update_capabilities has been deprecated (LunarVim#3245)
  fix(luadev): this plugin has been renamed (LunarVim#3235)
  fix: don't install desktop file w/o xdg-desktop-menu (LunarVim#3229)
  fix(alpha): check alpha module (LunarVim#3233)
  feat: latest impatient updates from upstream (LunarVim#3236)
  • Loading branch information
hexsailor committed Oct 16, 2022
2 parents c7b9b02 + 2a3b951 commit 449ff0e
Show file tree
Hide file tree
Showing 20 changed files with 357 additions and 236 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2.3.1
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v4
- uses: wagoid/commitlint-github-action@v5
with:
configFile: .github/workflows/commitlint.config.js
helpURL: https://github.com/LunarVim/LunarVim/blob/rolling/CONTRIBUTING.md#commit-messages
4 changes: 2 additions & 2 deletions .github/workflows/format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
name: "Formatting check with Stylua"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Lint with stylua
uses: JohnnyMorganz/stylua-action@v1
Expand All @@ -29,7 +29,7 @@ jobs:
name: "Formatting check with shfmt"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup Go
uses: actions/setup-go@v2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ jobs:
neovim: nightly
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install neovim binary from release
env:
RELEASE_VER: ${{ matrix.neovim }}
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
bash ./utils/installer/install-neovim-from-release
- name: Install LunarVim
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
shell: pwsh
steps:
# it's not currently possbile to run tests on windows, see nvim-lua/plenary.nvim#255
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install neovim binary
uses: rhysd/action-setup-vim@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
name: "Linting with luacheck"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: leafo/gh-actions-lua@v8
- uses: leafo/gh-actions-luarocks@v4
Expand All @@ -30,7 +30,7 @@ jobs:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,13 @@ jobs:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- uses: actions/checkout@v3

- name: Install neovim binary
uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: v0.8.0
version: nightly

- name: Install LunarVim
timeout-minutes: 4
Expand Down
2 changes: 2 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---@diagnostic disable
-- vim: ft=lua tw=80

stds.nvim = {
Expand Down Expand Up @@ -30,6 +31,7 @@ stds.nvim = {
std = "lua51+nvim"

files["tests/*_spec.lua"].std = "lua51+nvim+busted"
files["lua/lvim/impatient*"].ignore = {"121"}

-- Don't report unused self arguments of methods.
self = false
Expand Down
5 changes: 4 additions & 1 deletion lua/lvim/core/alpha.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ local function configure_additional_autocmds()
end

function M.setup()
local alpha = require "alpha"
local status_ok, alpha = pcall(require, "alpha")
if not status_ok then
return
end
local mode = lvim.builtin.alpha.mode
local config = lvim.builtin.alpha[mode].config

Expand Down
44 changes: 20 additions & 24 deletions lua/lvim/core/comment.lua
Original file line number Diff line number Diff line change
@@ -1,27 +1,10 @@
local M = {}

function M.config()
local pre_hook = nil
if lvim.builtin.treesitter.context_commentstring.enable then
pre_hook = function(ctx)
local U = require "Comment.utils"

-- Determine whether to use linewise or blockwise commentstring
local type = ctx.ctype == U.ctype.linewise and "__default" or "__multiline"

-- Determine the location where to calculate commentstring from
local location = nil
if ctx.ctype == U.ctype.blockwise then
location = require("ts_context_commentstring.utils").get_cursor_location()
elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then
location = require("ts_context_commentstring.utils").get_visual_start_location()
end

return require("ts_context_commentstring.internal").calculate_commentstring {
key = type,
location = location,
}
end
local pre_hook
local loaded, ts_comment = pcall(require, "ts_context_commentstring.integrations.comment_nvim")
if loaded and ts_comment then
pre_hook = ts_comment.create_pre_hook()
end
lvim.builtin.comment = {
active = true,
Expand All @@ -30,6 +13,11 @@ function M.config()
---@type boolean
padding = true,

---Whether cursor should stay at the
---same position. Only works in NORMAL
---mode mappings
sticky = true,

---Lines to be ignored while comment/uncomment.
---Could be a regex string or a function that returns a regex string.
---Example: Use '^$' to ignore empty lines
Expand All @@ -45,9 +33,6 @@ function M.config()
---Extra mapping
---Includes `gco`, `gcO`, `gcA`
extra = true,
---Extended mapping
---Includes `g>`, `g<`, `g>[count]{motion}` and `g<[count]{motion}`
extended = false,
},

---LHS of line and block comment toggle mapping in NORMAL/VISUAL mode
Expand All @@ -68,6 +53,17 @@ function M.config()
block = "gb",
},

---LHS of extra mappings
---@type table
extra = {
---Add comment on the line above
above = "gcO",
---Add comment on the line below
below = "gco",
---Add comment at the end of line
eol = "gcA",
},

---Pre-hook, called before commenting the line
---@type function|nil
pre_hook = pre_hook,
Expand Down
2 changes: 1 addition & 1 deletion lua/lvim/core/lualine/components.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ local statusline_hl = vim.api.nvim_get_hl_by_name("StatusLine", true)
local cursorline_hl = vim.api.nvim_get_hl_by_name("CursorLine", true)
local normal_hl = vim.api.nvim_get_hl_by_name("Normal", true)

vim.api.nvim_set_hl(0, "SLCopilot", { fg = "#6CC644", bg = "NONE" })
vim.api.nvim_set_hl(0, "SLCopilot", { fg = "#6CC644", bg = statusline_hl.background })
vim.api.nvim_set_hl(0, "SLGitIcon", { fg = "#E8AB53", bg = cursorline_hl.background })
vim.api.nvim_set_hl(0, "SLBranchName", { fg = normal_hl.foreground, bg = cursorline_hl.background })
vim.api.nvim_set_hl(0, "SLProgress", { fg = "#ECBE7B", bg = statusline_hl.background })
Expand Down
4 changes: 2 additions & 2 deletions lua/lvim/core/which-key.lua
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ M.config = function()
g = {
name = "Git",
g = { "<cmd>lua require 'lvim.core.terminal'.lazygit_toggle()<cr>", "Lazygit" },
j = { "<cmd>lua require 'gitsigns'.next_hunk()<cr>", "Next Hunk" },
k = { "<cmd>lua require 'gitsigns'.prev_hunk()<cr>", "Prev Hunk" },
j = { "<cmd>lua require 'gitsigns'.next_hunk({navigation_message = false})<cr>", "Next Hunk" },
k = { "<cmd>lua require 'gitsigns'.prev_hunk({navigation_message = false})<cr>", "Prev Hunk" },
l = { "<cmd>lua require 'gitsigns'.blame_line()<cr>", "Blame" },
p = { "<cmd>lua require 'gitsigns'.preview_hunk()<cr>", "Preview Hunk" },
r = { "<cmd>lua require 'gitsigns'.reset_hunk()<cr>", "Reset Hunk" },
Expand Down

0 comments on commit 449ff0e

Please sign in to comment.