Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
* upstream/master: (21 commits)
  chore: update changelog
  fix(installer) comment causes antivirus false positives (LunarVim#2818)
  fix(nvimtree): remove `indent_markers` icons trailing space (LunarVim#2854)
  fix: use pcall for setting up project.nvim (LunarVim#2762)
  fix(lvim/lsp/manager): make client_is_configured more reliable (LunarVim#2851)
  perf(cmp): remove redundant check for emmet-ls (LunarVim#2830)
  chore: update changelog
  feat(lsp): bind formatexpr and omnifunc by default (LunarVim#2865)
  chore: bump plugins version (LunarVim#2723)
  fix(packer): add max_jobs = 40 (LunarVim#2781)
  Update general-issue-form.yaml
  refactor(whichkey): use vim.keymap.set directly (LunarVim#2786)
  fix(core.comment): fix default extra mappings (LunarVim#2768)
  fix: typo in utils/installer/install.sh (LunarVim#2776)
  fix(lsp): update format filter for nightly (LunarVim#2773)
  feat: add commands to open/edit lvim logs (LunarVim#2709)
  fix dap-install (LunarVim#2772)
  feat(lsp): add option to override nlsp-settings (LunarVim#2769)
  feat(lsp): add option to override default `nvim-lsp-installer` settings (LunarVim#2698)
  fix(installer): always use check shallow clones (LunarVim#2763)
  ...
  • Loading branch information
hexsailor committed Aug 21, 2022
2 parents cebd73e + 47e4e5b commit b5c6674
Show file tree
Hide file tree
Showing 28 changed files with 292 additions and 209 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/general-issue-form.yaml
Expand Up @@ -33,7 +33,7 @@ body:
- type: input
id: nvim-version
attributes:
label: Neovim version (>= 0.7)
label: Neovim version (>= 0.7.2)
description: "Output of `nvim --version`"
placeholder: |
NVIM v0.8.0-dev+199-g2875d45e7
Expand Down
33 changes: 27 additions & 6 deletions .github/workflows/install.yaml
Expand Up @@ -6,40 +6,61 @@ on:
- "master"
- "rolling"
paths:
- '.github/workflows/**'
- 'lua/**'
- 'snapshots/**'
- 'tests/**'
- 'utils/**'

jobs:
unixish:
name: ${{ matrix.os }} ${{ matrix.runner }}
name: ${{ matrix.os }} ${{ matrix.runner }} (${{ matrix.neovim }})
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-20.04
- runner: ubuntu-latest
os: linux
- runner: macos-10.15
neovim: v0.7.0
- runner: macos-latest
os: osx
neovim: v0.7.0
- runner: ubuntu-22.04
os: linux
neovim: nightly
- runner: macos-12
os: osx
neovim: nightly
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v2

- name: Install neovim binary
- name: Install neovim binary from release
env:
RELEASE_VER: ${{ matrix.neovim }}
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
bash ./utils/installer/install-neovim-from-release
- name: Install LunarVim
timeout-minutes: 4
env:
LV_BRANCH: ${{ github.head_ref || github.ref_name }}
LV_REMOTE: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
LUNARVIM_LOG_LEVEL: "debug"
run: |
./utils/installer/install.sh --local --no-install-dependencies
export PATH="$HOME/.local/bin:$PATH"
installer_url="https://raw.githubusercontent.com/${LV_REMOTE}/${LV_BRANCH}/utils/installer/install.sh"
curl -LSsO "$installer_url"
bash ./install.sh --no-install-dependencies
- name: Run unit-tests
# NOTE: make sure to adjust the timeout if you start adding a lot of tests
timeout-minutes: 4
run: make test
run: |
nvim --version
make test
windows:
name: "windows-latest"
Expand Down
20 changes: 19 additions & 1 deletion CHANGELOG.md
Expand Up @@ -2,7 +2,7 @@

All notable changes to this project will be documented in this file.

## [unreleased]
## [1.1.4]

### <!-- 1 --> Features

Expand All @@ -12,6 +12,9 @@ All notable changes to this project will be documented in this file.
- _(icons)_ make it possible to disable icons ([#2529](https://github.com/lunarvim/lunarvim/pull/2529))
- _(installer)_ ensure correct responses when prompting user ([#2506](https://github.com/lunarvim/lunarvim/pull/2506))
- _(installer)_ add verify-plugins hook ([#2751](https://github.com/lunarvim/lunarvim/pull/2751))
- _(lsp)_ add option to override default `nvim-lsp-installer` settings ([#2698](https://github.com/lunarvim/lunarvim/pull/2698))
- _(lsp)_ add option to override nlsp-settings ([#2769](https://github.com/lunarvim/lunarvim/pull/2769))
- _(lsp)_ bind formatexpr and omnifunc by default ([#2865](https://github.com/lunarvim/lunarvim/pull/2865))
- _(lua-dev)_ use the newer lua-dev branch till folke comes back ([#2538](https://github.com/lunarvim/lunarvim/pull/2538))
- _(neovim)_ neovim 0.8 compatibility ([#2544](https://github.com/lunarvim/lunarvim/pull/2544))
- _(peek)_ make sure max width and height are customizable ([#2492](https://github.com/lunarvim/lunarvim/pull/2492))
Expand All @@ -23,6 +26,7 @@ All notable changes to this project will be documented in this file.
- add cmp-tmux to the list of sources ([#2542](https://github.com/lunarvim/lunarvim/pull/2542))
- prompt when closing modified/term buffers ([#2658](https://github.com/lunarvim/lunarvim/pull/2658))
- fix a couple of issues ([#2750](https://github.com/lunarvim/lunarvim/pull/2750))
- add commands to open/edit lvim logs ([#2709](https://github.com/lunarvim/lunarvim/pull/2709))

### <!-- 2 --> Bugfix

Expand All @@ -34,21 +38,28 @@ All notable changes to this project will be documented in this file.
- _(cmp)_ hotfix nvim-cmp version
- _(cmp)_ bring back default keybindings ([#2470](https://github.com/lunarvim/lunarvim/pull/2470))
- _(cmp)_ update nvim-cmp to the latest version ([#2467](https://github.com/lunarvim/lunarvim/pull/2467)) ([#2469](https://github.com/lunarvim/lunarvim/pull/2469))
- _(core.comment)_ fix default extra mappings ([#2768](https://github.com/lunarvim/lunarvim/pull/2768))
- _(dap)_ temporarily use dap-buddy dev branch which has older code ([#2567](https://github.com/lunarvim/lunarvim/pull/2567))
- _(dap)_ pause key binding commmand ([#2573](https://github.com/lunarvim/lunarvim/pull/2573))
- _(impatient)_ avoid get_options in fast handler ([#2451](https://github.com/lunarvim/lunarvim/pull/2451))
- _(installer)_ latest and specified release version for neovim have different urls ([#2484](https://github.com/lunarvim/lunarvim/pull/2484))
- _(installer)_ use full path to verify_plugins.lua ([#2755](https://github.com/lunarvim/lunarvim/pull/2755))
- _(installer)_ always use check shallow clones ([#2763](https://github.com/lunarvim/lunarvim/pull/2763))
- _(installer/pwsh)_ fixes some details on installer and uninstaller ([#2404](https://github.com/lunarvim/lunarvim/pull/2404))
- _(log)_ add date to the timestamp of logs ([#2669](https://github.com/lunarvim/lunarvim/pull/2669))
- _(lsp)_ undo stdpath overload to avoid datarace ([#2540](https://github.com/lunarvim/lunarvim/pull/2540))
- _(lsp)_ update format filter for nightly ([#2773](https://github.com/lunarvim/lunarvim/pull/2773))
- _(lualine)_ color theme gaps in some components ([#2465](https://github.com/lunarvim/lunarvim/pull/2465))
- _(lualine)_ unique buf client names ([#2683](https://github.com/lunarvim/lunarvim/pull/2683))
- _(luasnip)_ make sure all snippets are loaded ([#2447](https://github.com/lunarvim/lunarvim/pull/2447))
- _(luasnip)_ only use user snippets if the folder exists ([#2481](https://github.com/lunarvim/lunarvim/pull/2481))
- _(lvim/lsp/manager)_ make client_is_configured more reliable ([#2851](https://github.com/lunarvim/lunarvim/pull/2851))
- _(nvimtree)_ escape the dot character in custom filter ([#2493](https://github.com/lunarvim/lunarvim/pull/2493))
- _(nvimtree)_ make sure on_config_done is using the correct require ([#2509](https://github.com/lunarvim/lunarvim/pull/2509))
- _(nvimtree)_ add latest changes from nvimtree ([#2537](https://github.com/lunarvim/lunarvim/pull/2537))
- _(nvimtree)_ update nvim-tree setup ([#2681](https://github.com/lunarvim/lunarvim/pull/2681))
- _(nvimtree)_ remove `indent_markers` icons trailing space ([#2854](https://github.com/lunarvim/lunarvim/pull/2854))
- _(packer)_ add max_jobs = 40 ([#2781](https://github.com/lunarvim/lunarvim/pull/2781))
- _(readme)_ update lsp server ignore syntax
- _(readme)_ remove black as linter ([#2510](https://github.com/lunarvim/lunarvim/pull/2510))
- _(telescope)_ set <cr> binding to actions.select_default only ([#2395](https://github.com/lunarvim/lunarvim/pull/2395))
Expand All @@ -58,13 +69,16 @@ All notable changes to this project will be documented in this file.
- use correct cache path ([#2593](https://github.com/lunarvim/lunarvim/pull/2593))
- load notify's telescope extension properly ([#2586](https://github.com/lunarvim/lunarvim/pull/2586))
- skip calling nvim-tree.setup() more than once ([#2707](https://github.com/lunarvim/lunarvim/pull/2707))
- typo in utils/installer/install.sh ([#2776](https://github.com/lunarvim/lunarvim/pull/2776))
- use pcall for setting up project.nvim ([#2762](https://github.com/lunarvim/lunarvim/pull/2762))

### <!-- 3 --> Refactor

- _(lsp)_ replace deprecated ocamllsp with ocamlls ([#2402](https://github.com/lunarvim/lunarvim/pull/2402))
- _(lsp)_ cleanup servers' override configuration ([#2243](https://github.com/lunarvim/lunarvim/pull/2243))
- _(lsp)_ decouple the installer setup-hook ([#2536](https://github.com/lunarvim/lunarvim/pull/2536))
- _(telescope)_ don't overwrite default cmd to show hidden files
- _(whichkey)_ use vim.keymap.set directly ([#2786](https://github.com/lunarvim/lunarvim/pull/2786))
- re-enable packer.sync() in LvimReload ([#2410](https://github.com/lunarvim/lunarvim/pull/2410))
- update impatient ([#2477](https://github.com/lunarvim/lunarvim/pull/2477))
- lock new installations to nvim v0.7+ ([#2526](https://github.com/lunarvim/lunarvim/pull/2526))
Expand All @@ -81,6 +95,10 @@ All notable changes to this project will be documented in this file.

- do not run packer.sync() on every reload ([#2548](https://github.com/lunarvim/lunarvim/pull/2548))

### <!-- 6 --> Performance

- _(cmp)_ remove redundant check for emmet-ls ([#2830](https://github.com/lunarvim/lunarvim/pull/2830))

## [1.1.3]

### <!-- 1 --> Features
Expand Down
2 changes: 1 addition & 1 deletion lua/lvim/config/defaults.lua
Expand Up @@ -8,7 +8,7 @@ return {
---@usage timeout number timeout in ms for the format request (Default: 1000)
timeout = 1000,
---@usage filter func to select client
filter = require("lvim.lsp.handlers").format_filter,
filter = require("lvim.lsp.utils").format_filter,
},
keys = {},

Expand Down
17 changes: 0 additions & 17 deletions lua/lvim/core/cmp.lua
Expand Up @@ -22,20 +22,6 @@ local function feedkeys(key, mode)
end
M.methods.feedkeys = feedkeys

---checks if emmet_ls is available and active in the buffer
---@return boolean true if available, false otherwise
local is_emmet_active = function()
local clients = vim.lsp.buf_get_clients()

for _, client in pairs(clients) do
if client.name == "emmet_ls" then
return true
end
end
return false
end
M.methods.is_emmet_active = is_emmet_active

---when inside a snippet, seeks to the nearest luasnip field if possible, and checks if it is jumpable
---@param dir number 1 for forward, -1 for backward; defaults to 1
---@return boolean true if a jumpable luasnip field is found while inside a snippet
Expand Down Expand Up @@ -257,7 +243,6 @@ M.config = function()
["<C-j>"] = cmp.mapping.select_next_item(),
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
-- TODO: potentially fix emmet nonsense
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
Expand All @@ -267,8 +252,6 @@ M.config = function()
luasnip.jump(1)
elseif check_backspace() then
fallback()
elseif is_emmet_active() then
return vim.fn["cmp#complete"]()
else
fallback()
end
Expand Down
6 changes: 6 additions & 0 deletions lua/lvim/core/commands.lua
Expand Up @@ -65,6 +65,12 @@ M.defaults = {
print(require("lvim.utils.git").get_lvim_version())
end,
},
{
name = "LvimOpenlog",
fn = function()
vim.fn.execute("edit " .. require("lvim.core.log").get_path())
end,
},
}

function M.load(collection)
Expand Down
7 changes: 5 additions & 2 deletions lua/lvim/core/comment.lua
Expand Up @@ -26,9 +26,12 @@ function M.config()
---operator-pending mapping
---Includes `gcc`, `gcb`, `gc[count]{motion}` and `gb[count]{motion}`
basic = true,
---extended mapping
---Extra mapping
---Includes `gco`, `gcO`, `gcA`
extra = true,
---Extended mapping
---Includes `g>`, `g<`, `g>[count]{motion}` and `g<[count]{motion}`
extra = false,
extended = false,
},

---LHS of line and block comment toggle mapping in NORMAL/VISUAL mode
Expand Down
28 changes: 19 additions & 9 deletions lua/lvim/core/log.lua
Expand Up @@ -12,17 +12,27 @@ vim.tbl_add_reverse_lookup(Log.levels)
local notify_opts = {}

function Log:set_level(level)
-- package.loaded["lvim.core.log"] = nil
local log_level = Log.levels[level:upper()]
local status_ok, logger = pcall(require("structlog").get_logger, "lvim")
if status_ok then
for _, s in ipairs(logger.sinks) do
s.level = log_level
local logger_ok, _ = xpcall(function()
local log_level = Log.levels[level:upper()]
local structlog = require "structlog"
if structlog then
local logger = structlog.get_logger "lvim"
for _, s in ipairs(logger.sinks) do
s.level = log_level
end
end
end, debug.traceback)
if not logger_ok then
Log:debug("Unable to set logger's level: " .. debug.traceback())
end

package.loaded["packer.log"] = nil
require("packer.log").new { level = lvim.log.level }
local packer_ok, _ = xpcall(function()
package.loaded["packer.log"] = nil
require("packer.log").new { level = lvim.log.level }
end, debug.traceback)
if not packer_ok then
Log:debug("Unable to set packer's log level: " .. debug.traceback())
end
end

function Log:init()
Expand All @@ -36,7 +46,7 @@ function Log:init()
lvim = {
sinks = {
structlog.sinks.Console(log_level, {
async = false,
async = true,
processors = {
structlog.processors.Namer(),
structlog.processors.StackWriter({ "line", "file" }, { max_parents = 0, stack_level = 2 }),
Expand Down
7 changes: 4 additions & 3 deletions lua/lvim/core/nvimtree.lua
Expand Up @@ -68,9 +68,10 @@ function M.config()
indent_markers = {
enable = false,
icons = {
corner = "",
edge = "",
none = " ",
corner = "",
edge = "",
item = "",
none = " ",
},
},
icons = {
Expand Down
5 changes: 4 additions & 1 deletion lua/lvim/core/project.lua
Expand Up @@ -41,7 +41,10 @@ function M.config()
end

function M.setup()
local project = require "project_nvim"
local status_ok, project = pcall(require, "project_nvim")
if not status_ok then
return
end

project.setup(lvim.builtin.project)
if lvim.builtin.project.on_config_done then
Expand Down
50 changes: 26 additions & 24 deletions lua/lvim/core/telescope/custom-finders.lua
Expand Up @@ -55,33 +55,35 @@ function M.view_lunarvim_changelog()
}
opts.entry_maker = make_entry.gen_from_git_commits(opts)

pickers.new(opts, {
prompt_title = "~ LunarVim Changelog ~",
pickers
.new(opts, {
prompt_title = "~ LunarVim Changelog ~",

finder = finders.new_oneshot_job(
vim.tbl_flatten {
"git",
"log",
"--pretty=oneline",
"--abbrev-commit",
finder = finders.new_oneshot_job(
vim.tbl_flatten {
"git",
"log",
"--pretty=oneline",
"--abbrev-commit",
},
opts
),
previewer = {
previewers.git_commit_diff_as_was.new(opts),
},
opts
),
previewer = {
previewers.git_commit_diff_as_was.new(opts),
},

--TODO: consider opening a diff view when pressing enter
attach_mappings = function(_, map)
map("i", "<enter>", copy_to_clipboard_action)
map("n", "<enter>", copy_to_clipboard_action)
map("i", "<esc>", actions._close)
map("n", "<esc>", actions._close)
map("n", "q", actions._close)
return true
end,
sorter = sorters.generic_sorter,
}):find()
--TODO: consider opening a diff view when pressing enter
attach_mappings = function(_, map)
map("i", "<enter>", copy_to_clipboard_action)
map("n", "<enter>", copy_to_clipboard_action)
map("i", "<esc>", actions._close)
map("n", "<esc>", actions._close)
map("n", "q", actions._close)
return true
end,
sorter = sorters.generic_sorter,
})
:find()
end

-- Smartly opens either git_files or find_files, depending on whether the working directory is
Expand Down

0 comments on commit b5c6674

Please sign in to comment.