justinmk

justinmk

"People are afraid to merge." - Less Than Zero

Member Since 10 years ago

Berlin

Experience Points
890
follower
Lessons Completed
10
follow
Lessons Completed
350
stars
Best Reply Awards
44
repos

708 contributions in the last year

Pinned
⚡ The missing motion for Vim :athletic_shoe:
⚡ Directory viewer for Vim :zap:
⚡ Go to Terminal or File manager :point_right:
⚡ Vim syntax highlighting for c, bison, flex
⚡ personal dotfiles and settings
⚡ various notes
Activity
May
22
1 day ago
Activity icon
issue

justinmk issue comment neovim/neovim

justinmk
justinmk

Code Signature Invalid

Neovim version (nvim -v)

v0.8.0-dev+160-gdbdd58e54

Vim (not Nvim) behaves the same?

Not tested

Operating system/version

macOS 12.0.1

Terminal name/version

iTerm2 3.4.15

$TERM environment variable

xterm-256color

Installation

wget && tar xf && nvim-osx64/bin/nvim

How to reproduce the issue

$> wget https://github.com/neovim/neovim/releases/download/nightly/nvim-macos.tar.gz $> tar xf ./nvim-macos.tar.gz $> ./nvim-osx64/bin/nvim

Expected behavior

Run w/o error

Actual behavior

$> uname -m arm64 $> ./nvim-osx64/bin/nvim dyld[50126]: Library not loaded: @path/../libs/CoreServices Referenced from: /opt/nvim-osx64/bin/nvim Reason: tried: '/opt/nvim-osx64/bin/../libs/CoreServices' (code signature invalid (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x00001C30, codeBlobSize=0x000047E0 for '/opt/nvim-osx64/libs/CoreServices'), '/usr/local/lib/CoreServices' (no such file), '/usr/lib/CoreServices' (no such file) Abort trap: 6

Activity icon
issue

justinmk issue neovim/neovim

justinmk
justinmk

Mac OS x Catalina nvim.0.8 latest binary is not working

Neovim version (nvim -v)

0.8

Vim (not Nvim) behaves the same?

no

Operating system/version

Mac os x Catalina

Terminal name/version

iterm 2

$TERM environment variable

xterm-256

Installation

repo tar.gz mac binary

How to reproduce the issue

tar xzvf nvim-macos.tar.gz

and run nvim

Expected behavior

normal run

Actual behavior

crash Screen Shot 2022-05-23 at 00 48 36

Activity icon
issue

justinmk issue comment neovim/neovim

justinmk
justinmk

Mac OS x Catalina nvim.0.8 latest binary is not working

Neovim version (nvim -v)

0.8

Vim (not Nvim) behaves the same?

no

Operating system/version

Mac os x Catalina

Terminal name/version

iterm 2

$TERM environment variable

xterm-256

Installation

repo tar.gz mac binary

How to reproduce the issue

tar xzvf nvim-macos.tar.gz

and run nvim

Expected behavior

normal run

Actual behavior

crash Screen Shot 2022-05-23 at 00 48 36

pull request

justinmk merge to neovim/neovim

justinmk
justinmk

refactor!: delete insertmode

Neovim already removed evim (or any similar flags). The 'insertmode' option is a weird remnant, so get rid of it.

Activity icon
issue

justinmk issue comment neovim/neovim

justinmk
justinmk

:find does not prune 'wildignore' matches during file system traversal for <Tab>-completions generation

Neovim version (nvim -v)

NVIM v0.6.0-dev+542-g5ad15c9fa

Vim (not Nvim) behaves the same?

Yes, Vim 8.2.2029

Operating system/version

macOS 11

Terminal name/version

kitty 0.23.1, fish 3.3.1

$TERM environment variable

xterm-kitty

Installation

Build from source

How to reproduce the issue

  1. Find to a folder foo/ with a large tree under foo/bar/ but no other large trees under foo/ (something like foo/node_modules/, for example).
  2. cd foo/
  3. vim
  4. :set path+=**
  5. :find (something)<Tab>. Generating the completions will take a while because foo/bar/ is a large tree.
  6. :set wildignore+=*/bar/*
  7. :find (something)<Tab>. Now this should be snappy (assuming there are no other large trees under foo/), but it isn't. No completions under foo/bar are returned, but the file system traversal is clearly still walking the whole tree.
  8. This is easy to verify by executing mv foo/bar /tmp/bar repeating the above steps -- now :find (something)<Tab> will be snappy.

Expected behavior

I expected that :set wildignore+=*/bar/* would make tab completion using :find fast, because the under-the-hood :find traversal would prune all of foo/bar/ from its search.

Actual behavior

:find (something)<Tab> continues to be slow, because it traverses this large subtree. (I'm inferring the "because" since :find is fast if I just move the subtree somewhere else.)

(Vim issue: https://github.com/vim/vim/issues/9111)

justinmk
justinmk

Also I don't think it's true that

path=** basically defeats the purpose of 'path'

See https://github.com/neovim/neovim/issues/3209

"search the entire directory tree under $(pwd), except for node_modules", and wildignore

Does it work if you explicitly put **/ in the cmdline? That also can be a mapping. So setting 'path' is too blunt.

open pull request

justinmk wants to merge neovim/neovim

justinmk
justinmk

fixed w! displaying a message when the file was uptated externally

Small fix for https://github.com/neovim/neovim/issues/7270

I also added some tests to prevent regression.

justinmk
justinmk

just use single quotes. don't do this escaping stuff in descriptions.

  it(':w! does not show "file has been changed" warning', function()
pull request

justinmk merge to neovim/neovim

justinmk
justinmk

fixed w! displaying a message when the file was uptated externally

Small fix for https://github.com/neovim/neovim/issues/7270

I also added some tests to prevent regression.

pull request

justinmk pull request neovim/neovim

justinmk
justinmk

feat(lua)!: repurpose "-l" to execute Lua

nvim -l foo.lua
nvim -l foo.lua -- a b c
nvim -l foo.lua bar.txt
nvim -l foo.lua bar.txt +"put ='text'" -- a b c

closes #15749

Activity icon
created branch

justinmk in justinmk/neovim create branch lua

createdAt 14 hours ago
push

justinmk push justinmk/neovim

justinmk
justinmk

refactor: replace char_u variables and functions with char

Work on https://github.com/neovim/neovim/issues/459

justinmk
justinmk

refactor: add function xstrnsave

xstrnsave is a clone of vim_strnsave that uses char* instead of char_u*. Its purpose short-term is to help reduce the number of casts and for long-term to replace vim_strnsave as the need to use char_u is eliminated.

justinmk
justinmk

build(clint): change shebang to python3

There are distributions that doesn't symlink python to python3. This will make clint work for these without any additional steps from the user.

justinmk
justinmk

build(clint): remove all python2-isms with pyupgrade

The script is functionally the same, just with some nicer syntactic sugar thanks to only supporting python3.

justinmk
justinmk

Merge pull request #18197 from dundargoc/build/clint/python3

build/clint/python3

justinmk
justinmk

ci(backport): remove triggering by comment (#18210)

Triggering by comment is not needed. Applying the label is enough to trigger the backport action.

justinmk
justinmk
justinmk
justinmk

build(clang-format): align with project style #18192

justinmk
justinmk

vim-patch:8.2.4808: unused item in engine struct

Problem: Unused item in engine struct. Solution: Remove "expr". Add comment with tags. https://github.com/vim/vim/commit/33d3ce640c63366e26b84c8d6f5798187a258ee2

justinmk
justinmk

vim-patch:8.2.4810: missing changes in one file

Problem: Missing changes in one file. Solution: Also change the struct initializers. https://github.com/vim/vim/commit/56dba60216a1bf72c1de299316f4d4ef19e50ad5

justinmk
justinmk

vim-patch:8.2.4813: pasting text while indent folding may mess up folds

Problem: Pasting text while indent folding may mess up folds. Solution: Adjust the way folds are split. (Brandon Simmons, closes vim/vim#10254) https://github.com/vim/vim/commit/2c40707baa13a53cac4137ffb8b2ac67f50cea63

justinmk
justinmk

Merge pull request #18243 from zeertzjq/vim-8.2.4808

vim-patch:8.2.{4808,4810,4813}: pasting text while indent folding may mess up folds

justinmk
justinmk

vim-patch:8.2.4806: a mapping using does not start Select mode

Problem: A mapping using does not start Select mode. Solution: When checking for starting select mode with the mouse also do this when there is typeahead. (closes vim/vim#10249) https://github.com/vim/vim/commit/53ef5731480d8b5aa74137a09b3b164b436ed76b

justinmk
justinmk

vim-patch:8.2.4818: no test for what 8.2.4806 fixes

Problem: No test for what 8.2.4806 fixes. Solution: Add a test. (closes vim/vim#10727) https://github.com/vim/vim/commit/ac92ab771952b2a9ee39ea6fa5e70e4c072942d5

Test cannot be used because it must use test_setmouse(). Use a Lua test.

justinmk
justinmk

Merge pull request #18248 from zeertzjq/vim-8.2.4806

vim-patch:8.2.{4806,4818}: a mapping using does not start Select mode

justinmk
justinmk

fix(packaging): remove excess forward slash in Wix Patch (#18121)

justinmk
justinmk

ci: label all markdown edits as "documentation" #18120

justinmk
justinmk

docs: clarify enhanced modifiers, SHIFT usage #18124

Co-authored-by: Justin M. Keyes [email protected] Co-authored-by: zeertzjq [email protected]

justinmk
justinmk

build: bump Doxyfile to minimum required version 1.9.0 #18118

justinmk
justinmk

fix/PVS #17863

  • fix(PVS/V002): disable rule completely

V002: "Some diagnostic messages may contain incorrect line number in this file." This particular check seems unreliable. It says on their website https://pvs-studio.com/en/docs/warnings/v002/ that this warning occurs when there are multiline pragmas, but there are none in extmark.c.

  • fix(PVS/V756): ignore "counter is not used inside a nested loop" warning

The nested loop starts with "AutoCmd *ac = ap->cmds" so "ap" is definitely used.

  • fix(PVS/V560): disable "a part of conditional expression is always true"

  • fix(PVS/V614): potentially uninitialized variable 'blen' used

commit sha: 378615b8ee9440edb9ab7c71d847d03d52c61b2f

push time in 14 hours ago
Activity icon
issue

justinmk issue comment neovim/neovim

justinmk
justinmk

feat(autocmds): retrieve lua callback

continues the work done in #18617

feat(autocmds): retrieve lua callback

Example

  -- vim.api.nvim_create_augroup("test_group", { clear = true })
vim.api.nvim_create_autocmd("BufWritePre", {
  pattern = "*.py",
  group = "test_group",
  callback = function()
    print "hello1"
  end,
  desc = "dispatch hello1",
})

output of :lua =vim.api.nvim_get_autocmds { group = "test_group" })

{ {
    buflocal = false,
    callback = <function 1>,
    desc = "dispatch hello1",
    event = "BufWritePre",
    group = 52,
    group_name = "test_group",
    id = 60,
    once = false,
    pattern = "*.py"
  } }

you can use it as

local aus = vim.api.nvim_get_autocmds { group = "test_group" }
print(type(aus[1].callback)) -- --> function
aus[1].callback() -- --> hello1
justinmk
justinmk

cool! looks like nvim_get_keymap() already has this too. Any other API functions that need this?

Activity icon
issue

justinmk issue comment neovim/neovim

justinmk
justinmk

:find does not prune 'wildignore' matches during file system traversal for <Tab>-completions generation

Neovim version (nvim -v)

NVIM v0.6.0-dev+542-g5ad15c9fa

Vim (not Nvim) behaves the same?

Yes, Vim 8.2.2029

Operating system/version

macOS 11

Terminal name/version

kitty 0.23.1, fish 3.3.1

$TERM environment variable

xterm-kitty

Installation

Build from source

How to reproduce the issue

  1. Find to a folder foo/ with a large tree under foo/bar/ but no other large trees under foo/ (something like foo/node_modules/, for example).
  2. cd foo/
  3. vim
  4. :set path+=**
  5. :find (something)<Tab>. Generating the completions will take a while because foo/bar/ is a large tree.
  6. :set wildignore+=*/bar/*
  7. :find (something)<Tab>. Now this should be snappy (assuming there are no other large trees under foo/), but it isn't. No completions under foo/bar are returned, but the file system traversal is clearly still walking the whole tree.
  8. This is easy to verify by executing mv foo/bar /tmp/bar repeating the above steps -- now :find (something)<Tab> will be snappy.

Expected behavior

I expected that :set wildignore+=*/bar/* would make tab completion using :find fast, because the under-the-hood :find traversal would prune all of foo/bar/ from its search.

Actual behavior

:find (something)<Tab> continues to be slow, because it traverses this large subtree. (I'm inferring the "because" since :find is fast if I just move the subtree somewhere else.)

(Vim issue: https://github.com/vim/vim/issues/9111)

justinmk
justinmk

It's true that path=** basically defeats the purpose of 'path' so it's not really something that should be designed around.

wildignore is squarely ignored by the file search portion of :find foo<Tab> and only used by the completion portion, which only happens after the search part. In practice, this has zero negative effect if you use path and wildignore correctly.

So tab-complete has a "completion portion" and a "search portion"? If so, yes, that is a bug. Does this affect only :find, or does it affect tab-complete for other commands? Why would :find have a different tab-complete implementation than say :edit ?

open pull request

justinmk wants to merge neovim/neovim

justinmk
justinmk

feat(lsp)!: Turn format filter into predicate, add get_clients option

This makes the common use case easier and adds another option to preserve the possibility to handle more complex use cases - like choosing the client based on what other clients are available.

This also makes it a bit more consistent with other functions, like code_action where filter is already a predicate


If this looks good I'd do the same for rename


Note the breaking change is relative to master, the function is new in 0.8

justinmk
justinmk

I'm inclined to remove get_clients and just go with changing the signature of filter.

💯

pull request

justinmk merge to neovim/neovim

justinmk
justinmk

feat(lsp)!: Turn format filter into predicate, add get_clients option

This makes the common use case easier and adds another option to preserve the possibility to handle more complex use cases - like choosing the client based on what other clients are available.

This also makes it a bit more consistent with other functions, like code_action where filter is already a predicate


If this looks good I'd do the same for rename


Note the breaking change is relative to master, the function is new in 0.8

push

justinmk push neovim/neovim

justinmk
justinmk

fix(lsp): do not detach LSP servers on Windows #18703

Detaching the process seems to have unintended side effects on Windows, so only do it by default on non-Windows platforms.

Ref: https://github.com/neovim/nvim-lspconfig/issues/1907 Closes https://github.com/neovim/nvim-lspconfig/pull/1913

commit sha: 378615b8ee9440edb9ab7c71d847d03d52c61b2f

push time in 15 hours ago
pull request

justinmk pull request neovim/nvim-lspconfig

justinmk
justinmk

fix: tsserver detached false in windows

It seemed that I needed to set detached to false on Windows, as in https://github.com/neovim/nvim-lspconfig/issues/1907. I think I will set detached to false for all other servers as well, but I would appreciate your input.

pull request

justinmk pull request neovim/neovim

justinmk
justinmk

fix(lsp): do not detach LSP servers on Windows

Detaching the process seems to have unintended side effects on Windows, so only do it by default on non-Windows platforms.

Ref: https://github.com/neovim/nvim-lspconfig/issues/1907

The is_win check is copied from lsp/log.lua. I'm assuming this check is correct, I do not have a Windows machine to verify.

open pull request

justinmk wants to merge neovim/neovim

justinmk
justinmk

fix(lsp): do not detach LSP servers on Windows

Detaching the process seems to have unintended side effects on Windows, so only do it by default on non-Windows platforms.

Ref: https://github.com/neovim/nvim-lspconfig/issues/1907

The is_win check is copied from lsp/log.lua. I'm assuming this check is correct, I do not have a Windows machine to verify.

pull request

justinmk merge to neovim/neovim

justinmk
justinmk

fix(lsp): do not detach LSP servers on Windows

Detaching the process seems to have unintended side effects on Windows, so only do it by default on non-Windows platforms.

Ref: https://github.com/neovim/nvim-lspconfig/issues/1907

The is_win check is copied from lsp/log.lua. I'm assuming this check is correct, I do not have a Windows machine to verify.

open pull request

justinmk wants to merge neovim/neovim

justinmk
justinmk

feat(lsp): add a start_or_attach function

Putting this up for discussion.

This would be an alternative/subset of https://github.com/neovim/neovim/pull/18506 that I think would be forward compatible with a future project system.

Until the project system is in place users would have to configure FileType autocommands themselves, for example to setup vscode-json-languageserver one would drop the following into ftplugin/json.lua:

vim.lsp.start_or_attach({
  cmd = {'vscode-json-language-server', '--stdio'},
  name = 'json-ls',
  root_dir = vim.fs.find({'.git'}, { upward = true }),
})

(Or setup a au FileType json lua vim.lsp.start_or_attach { ... }, or via the nvim_create_autocmd API)

This could then be extended in both directions:

  • A future project system would provide a different reuse_client predicate (or we adapt the default implementation).
  • A lsp.config would automatically setup the FileType autocmds on lsp.config({}); start_or_attach could also be extended/changed that if only { name = ... } is present it would lookup the entries from lsp.config and merge them.

This will need https://github.com/neovim/neovim/pull/18583

justinmk
justinmk

ok, your call. I wonder though, if we had this feature from the beginning, would we make multiple functions for it or would it be a feature of start_client() ?

pull request

justinmk merge to neovim/neovim

justinmk
justinmk

feat(lsp): add a start_or_attach function

Putting this up for discussion.

This would be an alternative/subset of https://github.com/neovim/neovim/pull/18506 that I think would be forward compatible with a future project system.

Until the project system is in place users would have to configure FileType autocommands themselves, for example to setup vscode-json-languageserver one would drop the following into ftplugin/json.lua:

vim.lsp.start_or_attach({
  cmd = {'vscode-json-language-server', '--stdio'},
  name = 'json-ls',
  root_dir = vim.fs.find({'.git'}, { upward = true }),
})

(Or setup a au FileType json lua vim.lsp.start_or_attach { ... }, or via the nvim_create_autocmd API)

This could then be extended in both directions:

  • A future project system would provide a different reuse_client predicate (or we adapt the default implementation).
  • A lsp.config would automatically setup the FileType autocmds on lsp.config({}); start_or_attach could also be extended/changed that if only { name = ... } is present it would lookup the entries from lsp.config and merge them.

This will need https://github.com/neovim/neovim/pull/18583

pull request

justinmk pull request neovim/neovim

justinmk
justinmk

feat(lsp): add `jump_type` config option for location handler

Hi, it's my first pr! PR add config option for location handlers eg. textDocument/definition to open location in another type of window. If jump_type is nil handler behaves like it is working now.

-- for one mapping
vim.keymap.set("n", "gv", function()
  vim.lsp.buf.definition { jump_type = "vsplit" }
end, { buffer = bufnr })

-- or for all of them
vim.lsp.handlers["textDocument/definition"] = vim.lsp.with(
  vim.lsp.handlers.location, {
    -- Opens definition in new split
    jump_type = "vsplit"
  }
)
pull request

justinmk merge to neovim/neovim

justinmk
justinmk

feat(lsp): add `jump_type` config option for location handler

Hi, it's my first pr! PR add config option for location handlers eg. textDocument/definition to open location in another type of window. If jump_type is nil handler behaves like it is working now.

-- for one mapping
vim.keymap.set("n", "gv", function()
  vim.lsp.buf.definition { jump_type = "vsplit" }
end, { buffer = bufnr })

-- or for all of them
vim.lsp.handlers["textDocument/definition"] = vim.lsp.with(
  vim.lsp.handlers.location, {
    -- Opens definition in new split
    jump_type = "vsplit"
  }
)
pull request

justinmk merge to neovim/neovim

justinmk
justinmk

feat(lsp): add `jump_type` config option for location handler

Hi, it's my first pr! PR add config option for location handlers eg. textDocument/definition to open location in another type of window. If jump_type is nil handler behaves like it is working now.

-- for one mapping
vim.keymap.set("n", "gv", function()
  vim.lsp.buf.definition { jump_type = "vsplit" }
end, { buffer = bufnr })

-- or for all of them
vim.lsp.handlers["textDocument/definition"] = vim.lsp.with(
  vim.lsp.handlers.location, {
    -- Opens definition in new split
    jump_type = "vsplit"
  }
)
justinmk
justinmk
  • check if there are existing ways to "do something after an LSP action"
  • check if a general feature like an LspRequest / LspAction events would address this use-case
pull request

justinmk merge to neovim/neovim

justinmk
justinmk

feat(lsp): add `jump_type` config option for location handler

Hi, it's my first pr! PR add config option for location handlers eg. textDocument/definition to open location in another type of window. If jump_type is nil handler behaves like it is working now.

-- for one mapping
vim.keymap.set("n", "gv", function()
  vim.lsp.buf.definition { jump_type = "vsplit" }
end, { buffer = bufnr })

-- or for all of them
vim.lsp.handlers["textDocument/definition"] = vim.lsp.with(
  vim.lsp.handlers.location, {
    -- Opens definition in new split
    jump_type = "vsplit"
  }
)
justinmk
justinmk
  • check if there are existing ways to "do something after an LSP action"
  • check if a general feature like an LspRequest / LspAction events address this use-case
pull request

justinmk merge to neovim/neovim

justinmk
justinmk

feat(lsp): add `jump_type` config option for location handler

Hi, it's my first pr! PR add config option for location handlers eg. textDocument/definition to open location in another type of window. If jump_type is nil handler behaves like it is working now.

-- for one mapping
vim.keymap.set("n", "gv", function()
  vim.lsp.buf.definition { jump_type = "vsplit" }
end, { buffer = bufnr })

-- or for all of them
vim.lsp.handlers["textDocument/definition"] = vim.lsp.with(
  vim.lsp.handlers.location, {
    -- Opens definition in new split
    jump_type = "vsplit"
  }
)
justinmk
justinmk
  • check if there are existing ways to "do something after an LSP action"
  • check if a general feature like an LspRequest / LspAction events address this use-case
open pull request

justinmk wants to merge neovim/neovim

justinmk
justinmk

feat(lsp): add `jump_type` config option for location handler

Hi, it's my first pr! PR add config option for location handlers eg. textDocument/definition to open location in another type of window. If jump_type is nil handler behaves like it is working now.

-- for one mapping
vim.keymap.set("n", "gv", function()
  vim.lsp.buf.definition { jump_type = "vsplit" }
end, { buffer = bufnr })

-- or for all of them
vim.lsp.handlers["textDocument/definition"] = vim.lsp.with(
  vim.lsp.handlers.location, {
    -- Opens definition in new split
    jump_type = "vsplit"
  }
)
justinmk
justinmk
pull request

justinmk merge to neovim/neovim

justinmk
justinmk

feat(lsp): add `jump_type` config option for location handler

Hi, it's my first pr! PR add config option for location handlers eg. textDocument/definition to open location in another type of window. If jump_type is nil handler behaves like it is working now.

-- for one mapping
vim.keymap.set("n", "gv", function()
  vim.lsp.buf.definition { jump_type = "vsplit" }
end, { buffer = bufnr })

-- or for all of them
vim.lsp.handlers["textDocument/definition"] = vim.lsp.with(
  vim.lsp.handlers.location, {
    -- Opens definition in new split
    jump_type = "vsplit"
  }
)
Activity icon
issue

justinmk issue comment neovim/neovim

justinmk
justinmk

feat(lsp): add `jump_type` config option for location handler

Hi, it's my first pr! PR add config option for location handlers eg. textDocument/definition to open location in another type of window. If jump_type is nil handler behaves like it is working now.

-- for one mapping
vim.keymap.set("n", "gv", function()
  vim.lsp.buf.definition { jump_type = "vsplit" }
end, { buffer = bufnr })

-- or for all of them
vim.lsp.handlers["textDocument/definition"] = vim.lsp.with(
  vim.lsp.handlers.location, {
    -- Opens definition in new split
    jump_type = "vsplit"
  }
)
justinmk
justinmk

similar to https://github.com/neovim/neovim/issues/18625#issuecomment-1130504199 , I'm wondering if this is another case where you just need to run a custom callback on various lsp events.

This PR is adding vim.cmd() at a particular place. No real reason that is only for "jumps".

Previous