profile
viewpoint
TJ DeVries tjdevries https://www.twitch.tv/teej_dv Software developer. I like using Neovim (core team) and stream here: https://www.twitch.tv/teej_dv

tjdevries/config_manager 37

My configuration files and tools

nvim-lua/plenary.nvim 27

plenary: full; complete; entire; absolute; unqualified. All the lua functions I don't want to write twice.

tjdevries/express_line.nvim 21

WIP: Statusline written in pure lua. Supports co-routines, functions and jobs.

tjdevries/colorbuddy.vim 19

Your color buddy for making cool neovim color schemes

tjdevries/coc-zsh 12

coc.nvim source for Zsh completions

nvim-lua/wishlist 9

A public catalogue of Lua plugins Neovim users would like to see exist

sprout42/StarStruct 9

Python module that provides structured packing and unpacking of binary data streams

tjdevries/cyclist.vim 8

cycle + listchars

tjdevries/edit_alternate.vim 6

Quickly edit related / alternate files in vim.

tjdevries/apyrori.nvim 4

Auto imports for Python based on your current project

push eventneovim/neovim

TJ DeVries

commit sha 3ccdbc570d856ee3ff1f64204e352a40b9030ac2

lua: add vim.register_keystroke_callback (#12536) * feat: Add vim.register_keystroke_callback * fixup: Forgot to remove mention of old option * fixup: Answer jamessan comments * fixup: Answer norcalli comments * fixup: portability * Update runtime/doc/lua.txt Co-authored-by: Ashkan Kiani <ashkan.k.kiani@gmail.com>

view details

push time in 2 minutes

PR merged neovim/neovim

Reviewers
[RFC] Execute lua callback on keystroke lua

Proposal:

Add ability to run lua to inspect current keys and do whatever you want with them.

Why:

I want to show recently typed keys in a little floating window for streaming :)

@kdheepak Here's what I was thinking for taking the key logging / viewer to a whole different level.

+235 -1

18 comments

6 changed files

tjdevries

pr closed time in 2 minutes

push eventtjdevries/express_line.nvim

TJ DeVries

commit sha 465a3ceef424b4a87eb78fd90bc9a40a48619de1

Fixing up a few more items

view details

TJ DeVries

commit sha 4aeeb259536515dc676558793628780d67e84d57

luvjob -> plenary

view details

push time in 8 minutes

push eventtjdevries/luvjob.nvim

TJ DeVries

commit sha 72dc24cfe535bf83eec989b7dc02bc82ff68bffe

notice: Moving this to plenary.nvim

view details

push time in 12 minutes

push eventnvim-lua/plenary.nvim

TJ DeVries

commit sha 139214cfcd1a3d4cf54b8f4fdf19fb70e9671d88

feat(logging)

view details

TJ DeVries

commit sha 5571eebb52d9e04c8dad59604ee652d066422517

feat(job)

view details

TJ DeVries

commit sha 1271863822d806a0b5f507feb4620a3d81136d78

feat(reload)

view details

TJ DeVries

commit sha 1219df60d1b11d24964c2f01977822a6a80e6ab7

cleanup: Remove luvjob and make tests pass

view details

push time in 14 minutes

push eventneovim/neovim

Thomas Vigouroux

commit sha 613068071e02ddf5958fa82974373c370112c5e6

treesitter: refactor and use lua regexes

view details

Thomas Vigouroux

commit sha 18c0e775286aa6621d9190db8cf02e65a3f3d61f

treesitter(docs): update and refresh docs

view details

Thomas Vigouroux

commit sha 58e37d7df8ab3afc4d77e6ff1248d26a2559399e

treesitter: add contains? predicate

view details

Thomas Vigouroux

commit sha d7b12e58dfc7303dbc06381a9bedd5c3539d5413

treesitter: add and test vim-match? predicate

view details

Thomas Vigouroux

commit sha 9564803d1ad2c618176a917f974fb47ce1c598a9

treesitter: add predicate negation

view details

Thomas Vigouroux

commit sha 5900c99b7cbf603b26e1e4eff6428583f8e0c926

treesitter: update docs on predicates

view details

Thomas Vigouroux

commit sha 6a8dcfab4b2bada9c68379ee17235974fa8ad411

treesitter: allow to force predicate addition

view details

TJ DeVries

commit sha aa48c1c724f7164485782a3a5a8ff7a94373f607

Merge pull request #12739 from vigoux/ts-refactor-predicates treesitter: refactor

view details

push time in 2 hours

PR merged neovim/neovim

treesitter: refactor

This PR refactors the treesitter module (this is extracted from https://github.com/neovim/neovim/pull/12639).

It also removes the usage of vim regexes for the match predicates :

  • The complexity this added was unnecessary
  • Lua has regexes, they may be JIT optimized too
  • This now leverages the predicate handler feature this PR added.
+474 -214

7 comments

6 changed files

vigoux

pr closed time in 2 hours

push eventtjdevries/neovim

TJ DeVries

commit sha 7a862967110355476a016aad3f66cee62ef0c59b

fixup: portability

view details

push time in 10 hours

push eventtjdevries/vim9jit

TJ DeVries

commit sha 329b8452d4ad607fe840dd1fa78082b93b959d34

Add conditionals

view details

push time in 10 hours

push eventtjdevries/tree-sitter-nlua

TJ DeVries

commit sha d40ae7c174b31fcfa68450f75580c24e2adcab1d

Add some string and comment stuff... might have to use external scanner

view details

TJ DeVries

commit sha 9d62011434277331b71a19725d21dabaff7e6fef

Add fields for more stuff

view details

TJ DeVries

commit sha 39d480480f995bb8ebefd42575cc819709404f72

Hey, this isn't in the terminal...

view details

TJ DeVries

commit sha a04ff2a04e111e767dbc5ee38ffdbc0cde6f338d

[WIP]: Thu 13 Aug 2020 10:49:21 PM EDT

view details

TJ DeVries

commit sha f0eb17c43a6fd24abfce8676b3eb1645085aebc5

Got basic support working

view details

push time in 11 hours

startedgelguy/wilder.nvim

started time in 11 hours

issue commentnanotee/nvim-lua-guide

Lua Functions

Cool :+1: Great guide. Really appreciate it!

tjdevries

comment created time in 18 hours

Pull request review commentneovim/neovim

treesitter: refactor

 function Parser:_on_lines(bufnr, changed_tick, start_row, old_stop_row, stop_row   end end +--- Sets the included ranges for the current parser+--+-- @param ranges A table of nodes that will be used as the ranges the parser should include. function Parser:set_included_ranges(ranges)   self._parser:set_included_ranges(ranges)   -- The buffer will need to be parsed again later   self.valid = false end -local M = {-  parse_query = vim._ts_parse_query,-}+-- TODO(vigoux): not that great way to do it, but that __index method bothers me...+local M = vim.tbl_extend("error", query, lang)  setmetatable(M, {   __index = function (t, k)       if k == "TSHighlighter" then-        t[k] = require'vim.tshighlighter'+        t[k] = require'vim.treesitter.highlighter'

(we will delete the warning later. Decided offline)

vigoux

comment created time in 19 hours

Pull request review commentneovim/neovim

treesitter: refactor

+local a = vim.api+local language = require'vim.treesitter.language'++-- query: pattern matching on trees+-- predicate matching is implemented in lua+local Query = {}+Query.__index = Query++local M = {}++--- Parses a query.+--+-- @param language The language+-- @param query A string containing the query (s-expr syntax)+--+-- @returns The query+function M.parse_query(lang, query)+  language.require_language(lang)+  local self = setmetatable({}, Query)+  self.query = vim._ts_parse_query(lang, vim.fn.escape(query,'\\'))+  self.info = self.query:inspect()+  self.captures = self.info.captures+  return self+end++-- TODO(vigoux): support multiline nodes too++--- Gets the text corresponding to a given node+-- @param node the node+-- @param bufnr the buffer from which the node in extracted.+function M.get_node_text(node, bufnr)+  local start_row, start_col, end_row, end_col = node:range()+  if start_row ~= end_row then+    return nil+  end+  local line = a.nvim_buf_get_lines(bufnr, start_row, start_row+1, true)[1]+  return string.sub(line, start_col+1, end_col)+end++-- Predicate handler receive the following arguments+-- (match, pattern, bufnr, predicate)+local predicate_handlers = {+  ["eq?"] = function(match, _, bufnr, predicate)+      local node = match[predicate[2]]+      local node_text = M.get_node_text(node, bufnr)++      local str+      if type(predicate[3]) == "string" then+        -- (#eq? @aa "foo")+        str = predicate[3]+      else+        -- (#eq? @aa @bb)+        str = M.get_node_text(match[predicate[3]], bufnr)+      end++      if node_text ~= str or str == nil then+        return false+      end++      return true+  end,+  ["match?"] = function(match, _, bufnr, predicate)+      local node = match[predicate[2]]+      local regex = predicate[3]+      local start_row, _, end_row, _ = node:range()+      if start_row ~= end_row then+        return false+      end++      return string.find(M.get_node_text(node, bufnr), regex)+  end,++  ["vim-match?"] = (function()++    local magic_prefixes = {['\\v']=true, ['\\m']=true, ['\\M']=true, ['\\V']=true}+    local function check_magic(str)+      if string.len(str) < 2 or magic_prefixes[string.sub(str,1,2)] then+        return str+      end+      return '\\v'..str+    end++    local compiled_vim_regexes = setmetatable({}, {+      __index = function(t, pattern)+        local res = vim.regex(check_magic(pattern))+        rawset(t, pattern, res)+        return res+      end+    })++    return function(match, _, bufnr, pred)+      local node = match[pred[2]]+      local start_row, start_col, end_row, end_col = node:range()+      if start_row ~= end_row then+        return false+      end++      local regex = compiled_vim_regexes[pred[3]]+      return regex:match_line(bufnr, start_row, start_col, end_col)+    end+  end)(),++  ["contains?"] = function(match, _, bufnr, predicate)+    local node = match[predicate[2]]+    local node_text = M.get_node_text(node, bufnr)++    for i=3,#predicate do+      if string.find(node_text, predicate[i], 1, true) then+        return true+      end+    end++    return false+  end+}++--- Adds a new predicates to be used in queries+--+-- @param name the name of the predicate, without leading #+-- @param handler the handler function to be used+--    signature will be (match, pattern, bufnr, predicate)+function M.add_predicate(name, handler)+  if predicate_handlers[name] then+    a.nvim_err_writeln("It is recomended to not overwrite predicates.")

This should probably say the name that is being overwritten.

Could add an argument of force, which would make this error not print.

vigoux

comment created time in 20 hours

Pull request review commentneovim/neovim

treesitter: refactor

+local a = vim.api+local language = require'vim.treesitter.language'++-- query: pattern matching on trees+-- predicate matching is implemented in lua+local Query = {}+Query.__index = Query++local M = {}++--- Parses a query.+--+-- @param language The language+-- @param query A string containing the query (s-expr syntax)+--+-- @returns The query+function M.parse_query(lang, query)+  language.require_language(lang)+  local self = setmetatable({}, Query)+  self.query = vim._ts_parse_query(lang, vim.fn.escape(query,'\\'))+  self.info = self.query:inspect()+  self.captures = self.info.captures+  return self+end++-- TODO(vigoux): support multiline nodes too++--- Gets the text corresponding to a given node+-- @param node the node+-- @param bufnr the buffer from which the node in extracted.+function M.get_node_text(node, bufnr)+  local start_row, start_col, end_row, end_col = node:range()+  if start_row ~= end_row then+    return nil+  end+  local line = a.nvim_buf_get_lines(bufnr, start_row, start_row+1, true)[1]+  return string.sub(line, start_col+1, end_col)+end++-- Predicate handler receive the following arguments+-- (match, pattern, bufnr, predicate)+local predicate_handlers = {+  ["eq?"] = function(match, _, bufnr, predicate)+      local node = match[predicate[2]]+      local node_text = M.get_node_text(node, bufnr)++      local str+      if type(predicate[3]) == "string" then+        -- (#eq? @aa "foo")+        str = predicate[3]+      else+        -- (#eq? @aa @bb)+        str = M.get_node_text(match[predicate[3]], bufnr)+      end++      if node_text ~= str or str == nil then+        return false+      end++      return true+  end,+  ["match?"] = function(match, _, bufnr, predicate)

Needs space above to match the rest of the keys

vigoux

comment created time in 20 hours

Pull request review commentneovim/neovim

treesitter: refactor

+local a = vim.api+local language = require'vim.treesitter.language'++-- query: pattern matching on trees+-- predicate matching is implemented in lua+local Query = {}+Query.__index = Query++local M = {}++--- Parses a query.+--+-- @param language The language+-- @param query A string containing the query (s-expr syntax)+--+-- @returns The query+function M.parse_query(lang, query)+  language.require_language(lang)+  local self = setmetatable({}, Query)+  self.query = vim._ts_parse_query(lang, vim.fn.escape(query,'\\'))+  self.info = self.query:inspect()+  self.captures = self.info.captures+  return self+end++-- TODO(vigoux): support multiline nodes too++--- Gets the text corresponding to a given node+-- @param node the node+-- @param bufnr the buffer from which the node in extracted.+function M.get_node_text(node, bufnr)+  local start_row, start_col, end_row, end_col = node:range()+  if start_row ~= end_row then+    return nil+  end+  local line = a.nvim_buf_get_lines(bufnr, start_row, start_row+1, true)[1]+  return string.sub(line, start_col+1, end_col)+end++-- Predicate handler receive the following arguments+-- (match, pattern, bufnr, predicate)+local predicate_handlers = {+  ["eq?"] = function(match, _, bufnr, predicate)+      local node = match[predicate[2]]+      local node_text = M.get_node_text(node, bufnr)++      local str+      if type(predicate[3]) == "string" then+        -- (#eq? @aa "foo")+        str = predicate[3]+      else+        -- (#eq? @aa @bb)+        str = M.get_node_text(match[predicate[3]], bufnr)+      end++      if node_text ~= str or str == nil then+        return false+      end++      return true+  end,+  ["match?"] = function(match, _, bufnr, predicate)+      local node = match[predicate[2]]+      local regex = predicate[3]+      local start_row, _, end_row, _ = node:range()+      if start_row ~= end_row then+        return false+      end++      return string.find(M.get_node_text(node, bufnr), regex)+  end,++  ["vim-match?"] = (function()+

Remove empty line.

vigoux

comment created time in 20 hours

Pull request review commentneovim/neovim

treesitter: refactor

 query:iter_matches(node, bufnr, start_row, end_row) 	    ... use the info here ... 	  end 	end->-Treesitter syntax highlighting (WIP)		    *lua-treesitter-highlight*++Treesitter Query Predicates				*lua-treesitter-predicates*++When writing queries for treesitter, one might use `predicates`, that is,+special scheme nodes that are evaluted to verify things on a captured node for+example, the |eq?| predicate : >+	((identifier) @foo (#eq? @foo "foo"))++This will only match identifier corresponding to the `"foo"` text.+Here is a list of built-in predicates :++	`eq?`						*eq?*+		This predicate will check text correspondance between nodes or+		strings : >+			((identifier) @foo (#eq? @foo "foo"))+			((node1) @left (node2) @right (#eq? @left @right))+<+	`match?`					*match?*+		This will match if the provived lua regex matches the text+		corresponding to a node : >+			((idenfitier) @constant (#match? @constant "^[A-Z_]+$"))+<		Note: the `^` and `$` anchors will respectively match the+			start and end of the node's text.++	`vim-match?`					*vim-match?*+		This will match the same way than |match?| but using vim+		regexes.+	+	`contains?`					*contains?*+		Will check if any of the following arguments appears in the+		text corresponding to the node : >+			((identifier) @foo (#contains? @foo "foo"))+			((identifier) @foo-bar (#contains @foo-bar "foo" "bar"))+<+							*lua-treesitter-not-predicate*+Each predicate has a `not-` prefixed predicate that is just the negation of+the predicate.++vim.treesitter.query.add_predicate({name}, {handler})+					*vim.treesitter.query.add_predicate()*

This should be above, not below the signature.

vigoux

comment created time in 20 hours

startednvim-lua/wishlist

started time in 20 hours

push eventtjdevries/neovim

TJ DeVries

commit sha 4e4870f6e17ad5a761b29bca3b935b3003eed3cd

fixup: Answer norcalli comments

view details

push time in 20 hours

issue openednvim-lua/wishlist

Wish Granted Section

Section that keeps track of previous wishes and their solutions.

(might want to make a table of contents or something as well)

created time in a day

issue commenttjdevries/express_line.nvim

Neovim hangs on Windows

Hey, thanks for the bug report -- It's most likely that I have some issue on windows and it causes the status line to die. I'll take a look soon to fix this.

I might change the requirements to use plenary.nvim instead of luvjob, just as a heads up, since I'm thinking of incorporating luvjob there into my stdlib of neovim stuff. I'll update the readme accordingly when that happens (just install a different plugin basically).

akiyosi

comment created time in a day

push eventtjdevries/tree-sitter-nlua

TJ DeVries

commit sha 85ad52c7e1ab5a73a51dc8ed90819a2861cfde77

Emmy params documentated

view details

TJ DeVries

commit sha b319f1dcf346e277e4d1a60f71b3412e1dc02275

Working returns types

view details

TJ DeVries

commit sha 90ccd980bc29bc188998da52bbdcb249a870a056

return is the correct emmy lua way

view details

TJ DeVries

commit sha 17d031613a958c8e6044ce5d4842ca6287c540ea

Basics of docs coming through

view details

push time in a day

pull request commentneovim/neovim

[RFC] Execute lua callback on keystroke

Cool, answered those comments (and just removed the intermediate variable in the tests, since it didn't really need to be there at all).

tjdevries

comment created time in 2 days

push eventtjdevries/neovim

TJ DeVries

commit sha f5ebadfc5760af06f998a99dc98fd0063e9ce353

fixup: Answer jamessan comments

view details

push time in 2 days

PR opened ThePrimeagen/vim-be-good

PRIME PLZ PLZ PLZ

Example logging included.

+158 -0

0 comment

2 changed files

pr created time in 2 days

fork tjdevries/vim-be-good

vim-be-good is a nvim plugin designed to make you better at Vim Movements.

fork in 2 days

issue commentThePrimeagen/vim-apm

Unknown option: kscb

(part 2 only possible via changes in the plugin)

iiison

comment created time in 2 days

issue commentThePrimeagen/vim-apm

Unknown option: kscb

The option no longer exists after the PR was updated.

Additionally, id is changed to ns_id, so you need to create it w/ vim.api.nvim_create_namespace()

iiison

comment created time in 2 days

issue openednanotee/nvim-lua-guide

Lua Functions

This is just a drive by comment since we were chatting in gitter.

You can do something like this (which you can't do with v:lua)

lua X = function(k, v) return string.format("%s:%s", k, v) end
echo map([1, 2, 3], luaeval("X"))

Do with this information as you wish ;)

created time in 2 days

startedeuclidianAce/tree-sitter-teal

started time in 2 days

push eventtjdevries/config_manager

TJ DeVries

commit sha 45cd499d0b0d0c55a4fe2b0ec262f48f03994b67

Updates

view details

push time in 2 days

push eventtjdevries/tree-sitter-nlua

TJ DeVries

commit sha 4446ff0e5e0750f39f8de3f4b41bf9a417df6fe3

Closer to emmy lua

view details

push time in 3 days

push eventtjdevries/neovim

TJ DeVries

commit sha e60d1d2949f13eaa4b28006195db5d85790829ce

fixup: Forgot to remove mention of old option

view details

push time in 3 days

pull request commentneovim/neovim

[WIP] Execute lua callback on keystroke

I will not add a vimscript version of this, although if someone wanted to go through the work in the future, I will not oppose the PR.

tjdevries

comment created time in 3 days

pull request commentneovim/neovim

[WIP] Execute lua callback on keystroke

@norcalli @jamessan

I have removed the keystroke handling part of this PR, as we'll need to have a bit more discussion about how that will work (especially with forward thinking about user modes and more). This will be handled in a separate PR.

I have removed the global option, as it is pretty useless and icky (as mentioned by @jamessan ).

I have kept the tests that are applicable and updated the documentation as well.

While I understand the PR seems somewhat niche, there are already plugins and people doing interesting things based off of this WIP PR (see https://github.com/theprimeagen/vim-apm and https://github.com/ThePrimeagen/vim-apm/tree/timings) and I'd like to add some of my own features on top of it as well.

It is not possible to reproduce this kind of work just from the output of -W since you cannot run code at the moment of the keystroke.

For example, to answer @jamessan 's point about "buffer local" versions of this, you can simply do something like checking if the current buffer is the one that you want to be executing (and this is how I plan on not showing keystrokes done in the terminal for my eventual screen keys

tjdevries

comment created time in 3 days

push eventtjdevries/neovim

erw7

commit sha 9fc3949841817921a14fa64ae3d657c936acdfc4

shada: fix write E5004 error on exit Fix the problem of failing to write shada when the global variable contains Funcref or Partial.

view details

erw7

commit sha f1cbd39f7b12d2f7a2a528dbd034bacfe72809d2

vim-patch:8.2.0920: writing viminfo fails with a circular reference Problem: Writing viminfo fails with a circular reference. Solution: Use copyID to detect the cycle. (closes vim/vim#6217) https://github.com/vim/vim/commit/5b157fe2edfdce5f77080aeac2b4a03f39eb1c1a

view details

Anmol Sethi

commit sha 4aaffc5f339c248c12d2b9d87880bb73c714f369

man.vim: Refactor verify_exists to unset $MANSECT as needed Also cleaned it up a little and made it faster. Closes #9159 and #9271 Also changes man#extract_sect_and_name_ref to only return a single section at a time. This fixes a bug in its usage in man#goto_tag where get_paths would be called with multiple sections and it does not support that. I noticed that our tagfunc doesn't obey b:man_default_sects and I'll fix that next.

view details

Anmol Sethi

commit sha adc3425a3777c55080b7b5cdd37b02e858c5807c

man.vim: Fix tagfunc to respect b:man_default_sects Also, kudos to @zsugabubus for fixing a related issue in #12417 This also prevents any sorting of the paths from man. We need to respect the order we get from it otherwise you end up loading /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/share/man/man1/ls.1 on MacOS instead of /usr/share/man/man1/ls.1

view details

Anmol Sethi

commit sha e8ccd0f2347feb26071e8667d24f3281db79ede3

man.vim: Remove unnecessary code Not sure why this was added in https://github.com/neovim/neovim/commit/94f4469638590ca5cc724ab6459f2cfc78c621a4 It doesn't seem to do anything and I can't reproduce the linked issue with this patch so I think it's all working now. cc @justinmk

view details

Cédric Barreteau

commit sha 6420615e3f703870ed898083f84d6e3515a8c279

vim-patch:8.2.0935: flattening a list with existing code is slow Problem: Flattening a list with existing code is slow. Solution: Add flatten(). (Mopp, closes vim/vim#3676) https://github.com/vim/vim/commit/077a1e670ad69ef4cefc22103ca6635bd269e764

view details

Cédric Barreteau

commit sha fd57d69970e7947da0d69d744c13121668f91bd8

vim-patch:8.2.0937: asan failure in the flatten() test Problem: Asan failure in the flatten() test. Solution: Free the flattened list. https://github.com/vim/vim/commit/dcf59c37d0e1517439c4c0c4a6a5ca09c90157ad

view details

Cédric Barreteau

commit sha 9f7f42ea0a4ba85aa27f9d8dc3833e854ce54703

Prevent `flatten` from taking a null list

view details

Jan Edmund Lazo

commit sha 0c498200f42036a3aad9a7c2046016a0d2de6a7f

vim-patch:8.2.1169: write NUL past allocated space using corrupted spell file Problem: Write NUL past allocated space using corrupted spell file. (Markus Vervier) Solution: Init "c" every time. https://github.com/vim/vim/commit/97d2f34c8763ab3a46c9f43284cc17bad3cf9568 N/A patches for version.c: vim-patch:8.0.1531: cannot use 24 bit colors in MS-Windows console Problem: Cannot use 24 bit colors in MS-Windows console. Solution: Add support for vcon. (Nobuhiro Takasaki, Ken Takasaki, fixes vim/vim#1270, fixes vim/vim#2060) https://github.com/vim/vim/commit/cafafb381a04e33f3ce9cd15dd9f94b73226831f vim-patch:8.0.1544: when using 'termguicolors' SpellBad doesn't show Problem: When using 'termguicolors' SpellBad doesn't show. Solution: When the GUI colors are not set fall back to the cterm colors. https://github.com/vim/vim/commit/d4fc577e60d325777d38c00bd78fb9a32c7b1dfa vim-patch:8.0.1589: error for setting 'modifiable' when resetting it Problem: Error for setting 'modifiable' when resetting it. Solution: Check if 'modifiable' was actually set. https://github.com/vim/vim/commit/d7db27bafd1045281c965d9483539748a744de70 vim-patch:8.0.1591: MS-Windows: when reparsing the arguments 'wildignore' matters Problem: MS-Windows: when reparsing the arguments 'wildignore' matters. Solution: Save and reset 'wildignore'. (Yasuhiro Matsumoto, closes vim/vim#2702) https://github.com/vim/vim/commit/20586cb4f4d516a60b96cc02a94b810fea8b8cdb vim-patch:8.0.1712: terminal scrollback is not limited Problem: Terminal scrollback is not limited. Solution: Add the 'terminalscroll' option. https://github.com/vim/vim/commit/8c041b6b95f49f7383cf00e2036cf009b326fa8d Neovim has 'scrollback' option, not 'terminalscroll', to limit scrollback in terminal buffers. vim-patch:8.0.1745: build failure on MS-Windows Problem: Build failure on MS-Windows. Solution: Build job arguments for MS-Windows. Fix allocating job twice. https://github.com/vim/vim/commit/2060892028e05b1325dc0759259254180669eb5e vim-patch:8.0.1747: MS-Windows: term_start() does not set job_info() cmd Problem: MS-Windows: term_start() does not set job_info() cmd. Solution: Share the code from job_start() to set jv_argv. https://github.com/vim/vim/commit/ebe74b73677b06db7d483987a863b41cee051cc0

view details

Jan Edmund Lazo

commit sha be9de61012047b82e0f57742205e25a9a11ecf1c

vim-patch:8.2.1170: cursor off by one with block paste while 'virtualedit' "all" Problem: Cursor off by one with block paste while 'virtualedit' is "all". Solution: Adjust condition. (Hugo Gualandi, closes vim/vim#6430) https://github.com/vim/vim/commit/ef85a9b2d9e992ab594e089af3883e381cfad426 N/A patches for version.c: vim-patch:8.2.1114: terminal test sometimes times out Problem: Terminal test sometimes times out. Solution: Split the test in two parts. https://github.com/vim/vim/commit/1112c0febb509d0cb219f3a2479fd36833507167 vim-patch:8.2.1171: possible crash when out of memory Problem: Possible crash when out of memory. Solution: Check for NULL pointer. (Dominique Pellé, closes vim/vim#6432) https://github.com/vim/vim/commit/58bb61cf5ee008254eb331bc3574eac87d2dcc4a vim-patch:8.2.1172: error messages when doing "make clean" in doc or tee Problem: Error messages when doing "make clean" in the runtime/doc or src/tee directories. Solution: Use "rm -f". https://github.com/vim/vim/commit/08fc48492acc07259d91293df12bf66447819443 vim-patch:8.2.1173: tee doesn't build on some systems Problem: Tee doesn't build on some systems. Solution: Include header files. (Dominique Pelle, closes vim/vim#6431) https://github.com/vim/vim/commit/40043152924827fa8c4064951065ff507c610164 vim-patch:8.2.1177: terminal2 test sometimes hangs in the GUI Problem: Terminal2 test sometimes hangs in the GUI. Solution: Move some tests to other files to further locate the problem. Set the GUI to a fixed screen size. https://github.com/vim/vim/commit/18aa13d13b69c090dbe186cd4939896488c433e3 vim-patch:8.2.1179: Test_termwinscroll() sometimes hangs in the GUI Problem: Test_termwinscroll() sometimes hangs in the GUI. Solution: Skip the test in the GUI. https://github.com/vim/vim/commit/f65927fc8d0102ef2d0fea776381caedf4c51e32 vim-patch:8.2.1180: build failure in small version Problem: Build failure in small version. Solution: Add #ifdef. https://github.com/vim/vim/commit/1e624c912dff19e889c9398b56fe537952c02fef vim-patch:8.2.1181: json code not fully tested Problem: Json code not fully tested. Solution: Add more test coverage. (Dominique Pellé, closes vim/vim#6433) https://github.com/vim/vim/commit/21e5bdd271fa4d0ff4511cf74b160315e1d17cff

view details

Jan Edmund Lazo

commit sha db8682b94ec92e443a3d3e093732d3174075a5ee

vim-patch:8.2.0420: Vim9: cannot interrupt a loop with CTRL-C Problem: Vim9: cannot interrupt a loop with CTRL-C. Solution: Check for CTRL-C once in a while. Doesn't fully work yet. https://github.com/vim/vim/commit/f1ec378b014efb9897422c40369a6462163a512a Vim9 test, commented out in this patch, is restored in patch 8.2.0421. Vim9 tests were not ported over so skip the temporary change. Vim should stop pushing broken commits on master.

view details

Jan Edmund Lazo

commit sha 420aff590ae5f5ce7b6d807958a10b9fbd8c2594

vim-patch:8.2.0894: :mkspell can take very long if the word count is high Problem: :mkspell can take very long if the word count is high. Solution: Use long to avoid negative numbers. Increase the limits by 20% if the compression did not have effect. https://github.com/vim/vim/commit/59f88fbf24b21dbae114a79a15695fa2c3a09fca

view details

Jan Edmund Lazo

commit sha 65793a90d75c59d759b32dde01c0dc6a7fb4186c

vim-patch:8.2.0895: :mkspell output does not mention the tree type Problem: :mkspell output does not mention the tree type. Solution: Back out increasing the limits, it has no effect. Mention the tree being compressed. Only give a message once per second. https://github.com/vim/vim/commit/408c23b0794540ee3c568a1569f21406c5ed3ab8

view details

Jan Edmund Lazo

commit sha ab69ea26dccf4760a60882059a69b9245f767e2c

vim-patch:8.1.0819: a failed assert with a long string is hard to read Problem: A failed assert with a long string is hard to read. Solution: Shorten the assert message. https://github.com/vim/vim/commit/865767126e97d9ac65e052a657b29bbc32dcb512

view details

Jan Edmund Lazo

commit sha 93f2dc0d034677a47c9ba7032b3537c91a718096

vim-patch:8.2.0893: assert_equalfile() does not take a third argument Problem: Assert_equalfile() does not take a third argument. Solution: Implement the third argument. (Gary Johnson) https://github.com/vim/vim/commit/fb517bac2384798bb5142ed1f75f965f93984c0a

view details

Jan Edmund Lazo

commit sha bf882281800fe155536de487418d8052812446e5

vim-patch:8.2.0899: assert_equalfile() does not give a hint about the difference Problem: Assert_equalfile() does not give a hint about the difference. Solution: Display the last seen text. https://github.com/vim/vim/commit/30cc44a97f0ba1349e1a522dab22b11f47888183

view details

Jan Edmund Lazo

commit sha e16f2cbd123b5a7bd75b5810ec7641a93c99c009

vim-patch:8.2.0539: comparing two NULL list fails Problem: Comparing two NULL list fails. Solution: Change the order of comparing two lists. https://github.com/vim/vim/commit/7b293c730b07d1586688e622b8d9cbbb4a52379b N/A patches for version.c: vim-patch:8.2.1187: terminal2 test sometimes hangs in the GUI on Travis Problem: Terminal2 test sometimes hangs in the GUI on Travis. Solution: Disable Test_zz2_terminal_guioptions_bang() for now. https://github.com/vim/vim/commit/c85156bb897085d7f5a8e4e180287f87bf19b948 vim-patch:8.2.1188: memory leak with invalid json input Problem: Memory leak with invalid json input. Solution: Free all keys at the end. (Dominique Pellé, closes vim/vim#6443, closes vim/vim#6442) https://github.com/vim/vim/commit/6d3a7213f58da834b0fc869d05f87e86010c66cf vim-patch:8.2.1196: build failure with normal features Problem: Build failure with normal features. Solution: Add #ifdef. https://github.com/vim/vim/commit/83e7450053399942e1c9efa802c568b51d948541 vim-patch:8.2.1198: terminal2 test sometimes hangs in the GUI on Travis Problem: Terminal2 test sometimes hangs in the GUI on Travis. Solution: Move test function to terminal3 to see if the problem moves too. https://github.com/vim/vim/commit/a4b442614c5ca4ebf32acf5cf0b7b718496f1c94

view details

Jan Edmund Lazo

commit sha bb1f06fa82d9dd3c30b983068e51923cf50dc499

vim-patch:8.2.1211: removed more than dead code Problem: Removed more than dead code. Solution: Put back the decrement. https://github.com/vim/vim/commit/8455c5ed31c9cb2919f5e62693bab6b09bf60df2 N/A patch for version.c: vim-patch:8.2.1118: condition can never be true, dead code Problem: Condition can never be true, dead code. Solution: Remove the dead code. https://github.com/vim/vim/commit/810af5ea460eab820cc5899892067d8c242be688 vim-patch:8.2.1214: MS-Windows: default _vimrc not correct in silent install mode Problem: MS-Windows: default _vimrc not correct in silent install mode. Solution: Add the LoadDefaultVimrc macro. (Ken Takata, closes vim/vim#6451) https://github.com/vim/vim/commit/ceb56ddbafbca01e52ff4291d9480bf83d739793 vim-patch:8.2.1215: Atari MiNT support is outdated Problem: Atari MiNT support is outdated. Solution: Nobody responded this code is still useful, so let's delete it. https://github.com/vim/vim/commit/e3f915d12c8fe0466918a29ab4eaef153f71a2cd

view details

Jan Edmund Lazo

commit sha 140a372017c7649e156742622c9ccc1cd8b794c1

vim-patch:8.2.1222: using valgrind in Vim command started by test doesn't work Problem: When using valgrind a Vim command started by a test uses the same log file name which gets overwritten. Solution: Fix regexp to rename the log file. https://github.com/vim/vim/commit/657a826c07b4ea3f8846b6acb2c50b82c2d81e50

view details

erw7

commit sha 8e350c1c6922f9c678e83d97227e7edd84967571

startup: fix stall issue with -D options (#12652) fixes #12647.

view details

push time in 3 days

pull request commentwbthomason/packer.nvim

[WIP] Lua Rocks

Yeah, sounds good. I haven't heard back from anyone on luarocks about using luarocks as a module, so it doesn't seem possible currently, so we can probably just go forward w/ the shelling stuff out to system for now (and potentially forever).

tjdevries

comment created time in 3 days

pull request commentwbthomason/packer.nvim

[WIP] Lua Rocks

(Happy to reply to comments though as you're working through things or clear anything up in the issues we've chatted about above)

tjdevries

comment created time in 3 days

pull request commentwbthomason/packer.nvim

[WIP] Lua Rocks

tbh, I don't know how much time I have to finish it up right now -- if you want to take it to the finish line, that'd be great (especially since a lot of the back and forth we'll be doing I think will just be making it fit better into some more areas of the existing code base)

One thing I was thinking as well is it would be great to expose the "install" commands as able to run easily from other plugins.

So if someone didn't want to use packer, but did want to install luarocks stuff easily, they could just do require('packer.neorocks').install('lua-cjson') for example.

tjdevries

comment created time in 3 days

pull request commentneovim/neovim

viml: Literal Dicts

@janlazo or @erw7 thoughts on this? I probably should have done this via vim-path method, huh.... Wasn't really intending on making it resemble patches so closely, but it ended up being pretty simple.

I can just put the patches that are N/A in the final commit message, right?

tjdevries

comment created time in 4 days

pull request commentneovim/neovim

[RFC] lua: Force update of rtp more often

I restarted one the travis build that seemed flaky, but I don't think I can restart appveyor builds (only failed on 1/4 for appveyor, which is weird). @jamessan do we need to restart the appveyor one or is it fine?

tjdevries

comment created time in 4 days

startednanotee/nvim-lua-guide

started time in 4 days

push eventuntitled-ai/jupyter_ascending.pycharm

TJ DeVries

commit sha 53fec2e76c5d50dcb222c43376b986b5dab24fad

Add this as a test

view details

push time in 4 days

pull request commentneovim/neovim

[RFC] lua: Force update of rtp more often

OK, fixed up the two items you mentioned. Thanks for pointing them out.

tjdevries

comment created time in 4 days

push eventtjdevries/neovim

Shougo Matsushita

commit sha d3eddcf630f29da72409934eb14fb7a534f6497e

vim-patch:8.1.1564: sign column takes up space Problem: Sign column takes up space. (Adam Stankiewicz) Solution: Optionally put signs in the number column. (Yegappan Lakshmanan, closes vim/vim#4555, closes vim/vim#4515) https://github.com/vim/vim/commit/394c5d8870b15150fc91a4c058dc571fd5eaa97e

view details

erw7

commit sha bfe94d0a0814eab5e9f9b6c6b06e770ba904da9f

vim-patch:8.1.1623: display wrong with signs in narrow number column Problem: Display wrong with signs in narrow number column. Solution: Increase the numbercolumn width if needed. (Yegappan Lakshmanan, closes vim/vim#4606) https://github.com/vim/vim/commit/e4b407f536ba8bd007152649a347a95320d80fce

view details

erw7

commit sha 6b521ceeaf7dd3ad3169355c1c106139291e82e8

vim-patch:8.1.1712: signs in number column cause text to be misaligned Problem: Signs in number column cause text to be misaligned. Solution: Improve alignment. (Yasuhiro Matsumoto, closes vim/vim#4694) https://github.com/vim/vim/commit/d6bcff457799e491c3d27880858ec08e758e1849

view details

Shougo Matsushita

commit sha 1647e0a5b306dc6767a5298c8a9281a0fc7ace14

vim-patch:8.1.1564: sign column takes up space Problem: Sign column takes up space. (Adam Stankiewicz) Solution: Optionally put signs in the number column. (Yegappan Lakshmanan, closes vim/vim#4555, closes vim/vim#4515) https://github.com/vim/vim/commit/394c5d8870b15150fc91a4c058dc571fd5eaa97e

view details

Shougo Matsushita

commit sha 73340c1ce2ac44acd1604536ab9097f19b62e4ae

vim-patch:8.1.1570: icon signs not displayed properly in the number column Problem: Icon signs not displayed properly in the number column. Solution: Display them properly. (Yegappan Lakshmanan, closes vim/vim#4559) https://github.com/vim/vim/commit/4dff4aed09d2b0d570ca0d19de9cb08bdf03e695

view details

Matthieu Coudron

commit sha 602e7505e2cd47ce0f45236a5175709d8ce2c489

Merge pull request #12621 from Shougo/vim-8.1.1564 [RDY] vim-patch:8.1.1564, 1570, 1623, 1712 : sign column takes up space

view details

TJ DeVries

commit sha e797d0658c70c734485f54e070cc7300dc47db57

fix: runtimepath always updates lua package.path

view details

push time in 4 days

push eventtjdevries/neovim

Anmol Sethi

commit sha 7f49594813287d8134c52b3a9ee8ff099d525468

man.vim: Add - to 'iskeyword' (#12598) Pressing K on manpages with - in their name will now work. I noticed this the manpages of https://github.com/cli/cli

view details

Patrice Peterson

commit sha 1869f86e358b64eae69bbd004ab4822bdcc54870

Remove unused function (#12719)

view details

Shougo Matsushita

commit sha 3d7476a34f9cd7e38fae3dbcbc5270d938dc8c82

vim-patch:8.1.1564: sign column takes up space Problem: Sign column takes up space. (Adam Stankiewicz) Solution: Optionally put signs in the number column. (Yegappan Lakshmanan, closes vim/vim#4555, closes vim/vim#4515) https://github.com/vim/vim/commit/394c5d8870b15150fc91a4c058dc571fd5eaa97e

view details

erw7

commit sha 5871618c9af93cd634d47f5d48c8bbb06439b628

vim-patch:8.1.1623: display wrong with signs in narrow number column Problem: Display wrong with signs in narrow number column. Solution: Increase the numbercolumn width if needed. (Yegappan Lakshmanan, closes vim/vim#4606) https://github.com/vim/vim/commit/e4b407f536ba8bd007152649a347a95320d80fce

view details

erw7

commit sha 6f65f6db93070444f4fd9748b201e99e11076b7d

vim-patch:8.1.1712: signs in number column cause text to be misaligned Problem: Signs in number column cause text to be misaligned. Solution: Improve alignment. (Yasuhiro Matsumoto, closes vim/vim#4694) https://github.com/vim/vim/commit/d6bcff457799e491c3d27880858ec08e758e1849

view details

Shougo Matsushita

commit sha 607d67684cc6daa4b1ba5e19be86fed06de3d6ab

vim-patch:8.1.1564: sign column takes up space Problem: Sign column takes up space. (Adam Stankiewicz) Solution: Optionally put signs in the number column. (Yegappan Lakshmanan, closes vim/vim#4555, closes vim/vim#4515) https://github.com/vim/vim/commit/394c5d8870b15150fc91a4c058dc571fd5eaa97e

view details

Shougo Matsushita

commit sha 2ebb981f9be762081f286bc88f81746d3a6f125a

vim-patch:8.1.1570: icon signs not displayed properly in the number column Problem: Icon signs not displayed properly in the number column. Solution: Display them properly. (Yegappan Lakshmanan, closes vim/vim#4559) https://github.com/vim/vim/commit/4dff4aed09d2b0d570ca0d19de9cb08bdf03e695

view details

TJ DeVries

commit sha 99e949983d5a1424ffd3542e6867706070f90444

fix: runtimepath always updates lua package.path

view details

push time in 4 days

issue commentneovim/neovim

Merge vim method -> syntax

Thanks for compiling all the patches, that is very helpful.

I am attempting to dig into a few of these ( for example, literal dicts here: https://github.com/neovim/neovim/pull/12741 ), so I'm assigning myself for now.

milisims

comment created time in 4 days

Pull request review commentneovim/neovim

treesitter: refactor

+local a = vim.api+local lang = require'vim.treesitter.language'

Reversed "lang" and "language" here

vigoux

comment created time in 4 days

push eventtjdevries/neovim

Shougo Matsushita

commit sha d3eddcf630f29da72409934eb14fb7a534f6497e

vim-patch:8.1.1564: sign column takes up space Problem: Sign column takes up space. (Adam Stankiewicz) Solution: Optionally put signs in the number column. (Yegappan Lakshmanan, closes vim/vim#4555, closes vim/vim#4515) https://github.com/vim/vim/commit/394c5d8870b15150fc91a4c058dc571fd5eaa97e

view details

erw7

commit sha bfe94d0a0814eab5e9f9b6c6b06e770ba904da9f

vim-patch:8.1.1623: display wrong with signs in narrow number column Problem: Display wrong with signs in narrow number column. Solution: Increase the numbercolumn width if needed. (Yegappan Lakshmanan, closes vim/vim#4606) https://github.com/vim/vim/commit/e4b407f536ba8bd007152649a347a95320d80fce

view details

erw7

commit sha 6b521ceeaf7dd3ad3169355c1c106139291e82e8

vim-patch:8.1.1712: signs in number column cause text to be misaligned Problem: Signs in number column cause text to be misaligned. Solution: Improve alignment. (Yasuhiro Matsumoto, closes vim/vim#4694) https://github.com/vim/vim/commit/d6bcff457799e491c3d27880858ec08e758e1849

view details

Shougo Matsushita

commit sha 1647e0a5b306dc6767a5298c8a9281a0fc7ace14

vim-patch:8.1.1564: sign column takes up space Problem: Sign column takes up space. (Adam Stankiewicz) Solution: Optionally put signs in the number column. (Yegappan Lakshmanan, closes vim/vim#4555, closes vim/vim#4515) https://github.com/vim/vim/commit/394c5d8870b15150fc91a4c058dc571fd5eaa97e

view details

Shougo Matsushita

commit sha 73340c1ce2ac44acd1604536ab9097f19b62e4ae

vim-patch:8.1.1570: icon signs not displayed properly in the number column Problem: Icon signs not displayed properly in the number column. Solution: Display them properly. (Yegappan Lakshmanan, closes vim/vim#4559) https://github.com/vim/vim/commit/4dff4aed09d2b0d570ca0d19de9cb08bdf03e695

view details

Matthieu Coudron

commit sha 602e7505e2cd47ce0f45236a5175709d8ce2c489

Merge pull request #12621 from Shougo/vim-8.1.1564 [RDY] vim-patch:8.1.1564, 1570, 1623, 1712 : sign column takes up space

view details

TJ DeVries

commit sha d805cda629514355b54fc37fb7a1edb88a55e2a8

viml: Add literal dicts

view details

push time in 4 days

push eventtjdevries/neovim

Shougo Matsushita

commit sha 0090edd3dc2044bb861b48d72129129dd4b3975d

vim-patch:8.1.1564: sign column takes up space Problem: Sign column takes up space. (Adam Stankiewicz) Solution: Optionally put signs in the number column. (Yegappan Lakshmanan, closes vim/vim#4555, closes vim/vim#4515) https://github.com/vim/vim/commit/394c5d8870b15150fc91a4c058dc571fd5eaa97e

view details

erw7

commit sha 28f4799b49045ab8d118500bda950278a77ed997

vim-patch:8.1.1623: display wrong with signs in narrow number column Problem: Display wrong with signs in narrow number column. Solution: Increase the numbercolumn width if needed. (Yegappan Lakshmanan, closes vim/vim#4606) https://github.com/vim/vim/commit/e4b407f536ba8bd007152649a347a95320d80fce

view details

erw7

commit sha f69033871904daee8e1b6a9c79cd9ad220e5fc0a

vim-patch:8.1.1712: signs in number column cause text to be misaligned Problem: Signs in number column cause text to be misaligned. Solution: Improve alignment. (Yasuhiro Matsumoto, closes vim/vim#4694) https://github.com/vim/vim/commit/d6bcff457799e491c3d27880858ec08e758e1849

view details

Shougo Matsushita

commit sha 3f7286a259927e2a0fb19b0485545094d1131ac2

vim-patch:8.1.1564: sign column takes up space Problem: Sign column takes up space. (Adam Stankiewicz) Solution: Optionally put signs in the number column. (Yegappan Lakshmanan, closes vim/vim#4555, closes vim/vim#4515) https://github.com/vim/vim/commit/394c5d8870b15150fc91a4c058dc571fd5eaa97e

view details

Shougo Matsushita

commit sha 29e7ecec3e8c207363bc34ddcee941175a019e71

vim-patch:8.1.1570: icon signs not displayed properly in the number column Problem: Icon signs not displayed properly in the number column. Solution: Display them properly. (Yegappan Lakshmanan, closes vim/vim#4559) https://github.com/vim/vim/commit/4dff4aed09d2b0d570ca0d19de9cb08bdf03e695

view details

TJ DeVries

commit sha b4926ffac03a314ef2fae4f0a3bddf9ed4bb8957

viml: Add literal dicts

view details

push time in 4 days

push eventtjdevries/neovim

TJ DeVries

commit sha 242dd8bbd2d955269a552befc7eb24743f8785fb

[WIP]: Mon 10 Aug 2020 01:22:16 PM EDT

view details

push time in 4 days

pull request commentneovim/neovim

viml: Literal Dicts

Relevant patches:

8.1.1692 https://github.com/vim/vim/commit/b8be54dcc517c9d57b62409945b7d4b90b6c3071

tjdevries

comment created time in 4 days

PR opened neovim/neovim

viml: Literal Dicts

Adds literal dict support f or vim.

+78 -6

0 comment

2 changed files

pr created time in 4 days

create barnchtjdevries/neovim

branch : tjdevries/literal_dicts

created branch time in 4 days

issue commentnvim-treesitter/playground

Folder permissions for .cache directory not created correctly

https://github.com/kyazdani42/nvim-tree.lua/blob/master/lua/lib/fs.lua Might be useful.

steelsojka

comment created time in 4 days

pull request commentneovim/neovim

treesitter: refactor

Would it possible to have queries w/ vim regex still? Can we find a way to make it work w/ both (perhaps a way to specify you want vim regex).

It would be possible, but I find it misleading. The whole treesitter integration is implemented in lua, and, for consistency I find it better to have lua regexes there. Plus, most of our usage is just pretty simple regex matching (no capture groups or anything), so the switch will not be that hard.

I'm suggesting we have a different predicate (perhaps vim-match or similar) that still allows people to use the vim-based regexes (which are documented w/ in nvim and used elsewhere and many people have familiarity with and might want to test using / or similar).

Another thing would be if we could do something with string.find(..., true) (to do the literal match) for max max max speed (something instead of match? to like contains? or something like that).

I added another predicate named contains? that looks like this (#contains? @capture "text1" "text2" "text3") and that will match if any of the "text*" is contained in the text corresponding to @capture. Hopefully that's what you meant.

Yeah, contains looks really good. That is nice for doing literal search.

vigoux

comment created time in 4 days

issue commentneovim/neovim

init.lua as an alternative to init.vim

Works for me. I have no strong preference, just wanted to make sure that we all agreed on it. :smile:

justinmk

comment created time in 5 days

pull request commentneovim/neovim

API: nvim_api_get_doc

nvim_doc_get_lua, nvim_do_get_doxygen, idk maybe more? :) I think just think it's a better namespace though.

smolck

comment created time in 5 days

Pull request review commentneovim/neovim

treesitter: refactor

 static int nlua_schedule(lua_State *const lstate) ; defaults to very magic syntax, for best compatibility

Some of these comments seem not true anymore.

vigoux

comment created time in 5 days

Pull request review commentneovim/neovim

treesitter: refactor

+local a = vim.api+local lang = require'vim.treesitter.language'++-- query: pattern matching on trees+-- predicate matching is implemented in lua+local Query = {}+Query.__index = Query++local M = {}++--- Parses a query.+--+-- @param language The language+-- @param query A string containing the query (s-expr syntax)+--+-- @returns The query+function M.parse_query(language, query)+  lang.require_language(language)+  local self = setmetatable({}, Query)+  self.query = vim._ts_parse_query(language, vim.fn.escape(query,'\\'))+  self.info = self.query:inspect()+  self.captures = self.info.captures+  for id, preds in pairs(self.info.patterns) do+    local regexes = {}+  end+  return self+end++-- TODO(vigoux): support multiline nodes too+local function get_node_text(node, bufnr)+  local start_row, start_col, end_row, end_col = node:range()+  if start_row ~= end_row then+    return nil+  end+  local line = a.nvim_buf_get_lines(bufnr, start_row, start_row+1, true)[1]+  return string.sub(line, start_col+1, end_col)+end++-- Predicate handler receive the following arguments+-- (match, pattern, bufnr, regexes, index, predicate)+local predicate_handlers = {+  ["eq?"] = function(match, _, bufnr, predicate)+      local node = match[predicate[2]]+      local node_text = get_node_text(node, bufnr)++      local str+      if type(predicate[3]) == "string" then+        -- (#eq? @aa "foo")+        str = predicate[3]+      else+        -- (#eq? @aa @bb)+        str = get_node_text(match[predicate[3]], bufnr)+      end++      if node_text ~= str or str == nil then+        return false+      end++      return true+  end,+  ["match?"] = function(match, _, bufnr, predicate)+      local node = match[predicate[2]]+      local regex = predicate[3]+      local start_row, start_col, end_row, end_col = node:range()+      if start_row ~= end_row then+        return false+      end++      return string.find(get_node_text(node, bufnr), regex)+  end,+}++function M.add_predicate(name, handler)+  predicate_handlers[name] = handler+end++function Query:match_preds(match, pattern, bufnr)+  local preds = self.info.patterns[pattern]+  if not preds then+    return true+  end+  for i, pred in pairs(preds) do+    -- Here we only want to return if a predicate DOES NOT match, and+    -- continue on the other case. This way unknown predicates will not be considered,+    -- which allows some testing and easier user extensibility (#12173).+    -- Also, tree-sitter strips the leading # from predicates for us.

A bunch of these comments could move to the documentation and explain how it works with adding predicates.

vigoux

comment created time in 5 days

Pull request review commentneovim/neovim

treesitter: refactor

+local a = vim.api+local lang = require'vim.treesitter.language'++-- query: pattern matching on trees+-- predicate matching is implemented in lua+local Query = {}+Query.__index = Query++local M = {}++--- Parses a query.+--+-- @param language The language+-- @param query A string containing the query (s-expr syntax)+--+-- @returns The query+function M.parse_query(language, query)+  lang.require_language(language)+  local self = setmetatable({}, Query)+  self.query = vim._ts_parse_query(language, vim.fn.escape(query,'\\'))+  self.info = self.query:inspect()+  self.captures = self.info.captures+  for id, preds in pairs(self.info.patterns) do+    local regexes = {}+  end+  return self+end++-- TODO(vigoux): support multiline nodes too+local function get_node_text(node, bufnr)+  local start_row, start_col, end_row, end_col = node:range()+  if start_row ~= end_row then+    return nil+  end+  local line = a.nvim_buf_get_lines(bufnr, start_row, start_row+1, true)[1]+  return string.sub(line, start_col+1, end_col)+end++-- Predicate handler receive the following arguments+-- (match, pattern, bufnr, regexes, index, predicate)+local predicate_handlers = {+  ["eq?"] = function(match, _, bufnr, predicate)+      local node = match[predicate[2]]+      local node_text = get_node_text(node, bufnr)++      local str+      if type(predicate[3]) == "string" then+        -- (#eq? @aa "foo")+        str = predicate[3]+      else+        -- (#eq? @aa @bb)+        str = get_node_text(match[predicate[3]], bufnr)+      end++      if node_text ~= str or str == nil then+        return false+      end++      return true+  end,+  ["match?"] = function(match, _, bufnr, predicate)+      local node = match[predicate[2]]+      local regex = predicate[3]+      local start_row, start_col, end_row, end_col = node:range()+      if start_row ~= end_row then+        return false+      end++      return string.find(get_node_text(node, bufnr), regex)+  end,+}++function M.add_predicate(name, handler)

Needs documentation.

vigoux

comment created time in 5 days

Pull request review commentneovim/neovim

treesitter: refactor

+local a = vim.api+local lang = require'vim.treesitter.language'++-- query: pattern matching on trees+-- predicate matching is implemented in lua+local Query = {}+Query.__index = Query++local M = {}++--- Parses a query.+--+-- @param language The language+-- @param query A string containing the query (s-expr syntax)+--+-- @returns The query+function M.parse_query(language, query)+  lang.require_language(language)+  local self = setmetatable({}, Query)+  self.query = vim._ts_parse_query(language, vim.fn.escape(query,'\\'))+  self.info = self.query:inspect()+  self.captures = self.info.captures+  for id, preds in pairs(self.info.patterns) do+    local regexes = {}+  end+  return self+end++-- TODO(vigoux): support multiline nodes too+local function get_node_text(node, bufnr)+  local start_row, start_col, end_row, end_col = node:range()+  if start_row ~= end_row then+    return nil+  end+  local line = a.nvim_buf_get_lines(bufnr, start_row, start_row+1, true)[1]+  return string.sub(line, start_col+1, end_col)+end++-- Predicate handler receive the following arguments+-- (match, pattern, bufnr, regexes, index, predicate)+local predicate_handlers = {+  ["eq?"] = function(match, _, bufnr, predicate)+      local node = match[predicate[2]]+      local node_text = get_node_text(node, bufnr)++      local str+      if type(predicate[3]) == "string" then+        -- (#eq? @aa "foo")+        str = predicate[3]+      else+        -- (#eq? @aa @bb)+        str = get_node_text(match[predicate[3]], bufnr)+      end++      if node_text ~= str or str == nil then+        return false+      end++      return true+  end,+  ["match?"] = function(match, _, bufnr, predicate)+      local node = match[predicate[2]]+      local regex = predicate[3]+      local start_row, start_col, end_row, end_col = node:range()+      if start_row ~= end_row then+        return false+      end++      return string.find(get_node_text(node, bufnr), regex)+  end,+}++function M.add_predicate(name, handler)+  predicate_handlers[name] = handler

May want to warn if name already exists (overwriting built-in could have bad side effects, for example). Or even prevent overriding the defaults, for example.

vigoux

comment created time in 5 days

pull request commentneovim/neovim

treesitter: refactor

Another thing would be if we could do something with string.find(..., true) (to do the literal match) for max max max speed (something instead of match? to like contains? or something like that).

vigoux

comment created time in 5 days

pull request commentneovim/neovim

treesitter: refactor

(I agree though that for many cases, the lua regex would probably be good enough and faster, especially when jit compiled)

vigoux

comment created time in 5 days

pull request commentneovim/neovim

treesitter: refactor

Would it possible to have queries w/ vim regex still? Can we find a way to make it work w/ both (perhaps a way to specify you want vim regex).

I think it is helpful to use vim regexes within vim -- or at least having the option to do so.

vigoux

comment created time in 5 days

Pull request review commentneovim/neovim

treesitter: refactor

 local a = vim.api+local query = require'vim.treesitter.query'+local lang = require'vim.treesitter.language'

I still feel the same about not liking the lang and language all within one file -- especially since language is the file but you import it as lang. I find that confusing

vigoux

comment created time in 5 days

Pull request review commentneovim/neovim

treesitter: refactor

 function Parser:_on_lines(bufnr, changed_tick, start_row, old_stop_row, stop_row   end end +--- Sets the included ranges for the current parser+--+-- @param ranges A table of nodes that will be used as the ranges the parser should include. function Parser:set_included_ranges(ranges)   self._parser:set_included_ranges(ranges)   -- The buffer will need to be parsed again later   self.valid = false end -local M = {-  parse_query = vim._ts_parse_query,-}+-- TODO(vigoux): not that great way to do it, but that __index method bothers me...+local M = vim.tbl_extend("error", query, lang)  setmetatable(M, {   __index = function (t, k)       if k == "TSHighlighter" then-        t[k] = require'vim.tshighlighter'+        t[k] = require'vim.treesitter.highlighter'

I'm fine w/ removing it, was just thinking we may remove it before the next release and give people a week or two to update w/out breaking. Fine w/ just a message that tells them what to do (and then removing the message shortly after)

vigoux

comment created time in 5 days

issue commentneovim/neovim

Built in Context Menu

I'm not sure I understand what the goal would be for it to be made within neovim core.

atishay

comment created time in 5 days

Pull request review commentneovim/neovim

[WIP] fswatch autoread

 A jump table for the options with a short description can be found at |Q_op|. 	This option is reset when the 'paste' option is set and restored when 	the 'paste' option is reset. +				*'filechangenotify'* *'fcnotify'*+'filechangenotify' 'fcnotify'	string (default "off")+				local to buffer+	Watch for changes to a file. How to react for the changes depends on+	the value of the option. The option can take following values:+	+		off	Don't react to changes happening to a file.+		always	Always notify about the changes to a file, by+			prompting the user for a reload.+		changed	Notify about the changes to a file and prompt for a+			reload if there are unsaved changes in a buffer. Else+			update the buffer.

Not up to date anymore I think.

BK1603

comment created time in 6 days

Pull request review commentneovim/neovim

[WIP] fswatch autoread

+-- Create a file watcher, each watcher is identified by the name of the file that it+-- watches.++local uv = vim.loop+local Watcher = {}+local w = {}+local WatcherList = {}+local commence = nil++--- Callback for the check handle, checks if there are pending notifications+--- for any watcher, and handles them as per the value of the `fcnotify`+--- option.+local function check_notifications()+  for _, watcher in pairs(WatcherList) do+    local option = vim.api.nvim_buf_get_option(watcher.bufnr, 'filechangenotify')+    if watcher.pending_notifs and watcher.paused == false and option ~= 'off' then+      if uv.fs_stat(watcher.ffname) ~= nil then+        vim.api.nvim_command('checktime '..watcher.bufnr)+        watcher.pending_notifs = false+      else+        error("ERR: File "..watcher.fname.." removed")+      end+    end+  end+end++--- Checks if a buffer should have a watcher attached to it.+--- Ignores all the buffers that aren't listed, or have a buf id+--- less than 0.+--- Ignores the [NO NAME] buffer.+---+--@param fname: The validity of this buffer will be checked.+local function valid_buf(fname)+  if fname == '' then+    return false+  end++  local bufnr = vim.api.nvim_call_function('bufnr', {fname})++  if bufnr < 0 then+    return false+  end++  local buflisted = vim.api.nvim_buf_get_option(bufnr, 'buflisted')+  local buftype = vim.api.nvim_buf_get_option(bufnr, 'buftype')++  if not buflisted or buftype == 'nofile' or buftype == 'quickfix' then+    return false+  end+  return true+end++local check_handle = uv.new_check()+check_handle:start(vim.schedule_wrap(check_notifications))++--- Creates and initializes a new watcher object with the given filename.+---+--@param fname: (required, string) The path that the watcher should watch.+function Watcher:new(fname)+  vim.validate{fname = {fname, 'string', false}}+  -- get full path name for the file+  local ffname = vim.api.nvim_call_function('fnamemodify', {fname, ':p'})+  w = {bufnr = vim.api.nvim_call_function('bufnr', {fname}),+       fname = fname, ffname = ffname, handle = nil,+       paused = false, pending_notifs = false}+  setmetatable(w, self)+  self.__index = self+  return w+end++local function start_poll(fname)+  WatcherList[fname].handle = uv.new_fs_poll()+  WatcherList[fname].handle:start(WatcherList[fname].ffname, 200, function(...)+    WatcherList[fname]:poll_change(...)+  end)+end++--- Starts the watcher+---+--@param self: (required, table) The watcher object on which start was called.+local function start_watch(fname)+  WatcherList[fname].handle = uv.new_fs_event()+  WatcherList[fname].handle:start(WatcherList[fname].ffname, {}, function(...)+    WatcherList[fname]:watch_change(...)+  end)+end++function Watcher:start()+  if self.handle and not self.handle:is_closing() then+    self.handle:close()+  end++  commence(self.fname)+end++function Watcher.init_poll()

Can you change these names to something like _set_warching_mechanism? I don't care the exact name, but it's not exactly init something, since it looks like you can change it any time you want.

BK1603

comment created time in 6 days

Pull request review commentneovim/neovim

[WIP] fswatch autoread

+-- Create a file watcher, each watcher is identified by the name of the file that it+-- watches.++local uv = vim.loop+local Watcher = {}+local w = {}+local WatcherList = {}+local commence = nil++--- Callback for the check handle, checks if there are pending notifications+--- for any watcher, and handles them as per the value of the `fcnotify`+--- option.+local function check_notifications()+  for _, watcher in pairs(WatcherList) do+    local option = vim.api.nvim_buf_get_option(watcher.bufnr, 'filechangenotify')+    if watcher.pending_notifs and watcher.paused == false and option ~= 'off' then+      if uv.fs_stat(watcher.ffname) ~= nil then+        vim.api.nvim_command('checktime '..watcher.bufnr)+        watcher.pending_notifs = false+      else+        error("ERR: File "..watcher.fname.." removed")+      end+    end+  end+end++--- Checks if a buffer should have a watcher attached to it.+--- Ignores all the buffers that aren't listed, or have a buf id+--- less than 0.+--- Ignores the [NO NAME] buffer.+---+--@param fname: The validity of this buffer will be checked.+local function valid_buf(fname)+  if fname == '' then+    return false+  end++  local bufnr = vim.api.nvim_call_function('bufnr', {fname})++  if bufnr < 0 then+    return false+  end++  local buflisted = vim.api.nvim_buf_get_option(bufnr, 'buflisted')+  local buftype = vim.api.nvim_buf_get_option(bufnr, 'buftype')++  if not buflisted or buftype == 'nofile' or buftype == 'quickfix' then+    return false+  end+  return true+end++local check_handle = uv.new_check()+check_handle:start(vim.schedule_wrap(check_notifications))++--- Creates and initializes a new watcher object with the given filename.+---+--@param fname: (required, string) The path that the watcher should watch.+function Watcher:new(fname)+  vim.validate{fname = {fname, 'string', false}}+  -- get full path name for the file+  local ffname = vim.api.nvim_call_function('fnamemodify', {fname, ':p'})+  w = {bufnr = vim.api.nvim_call_function('bufnr', {fname}),+       fname = fname, ffname = ffname, handle = nil,+       paused = false, pending_notifs = false}+  setmetatable(w, self)+  self.__index = self

You can set this just once abovve. I recommend moving definition of Watcher to line 55-ish. And then you can do Watcher.__index = Watcher

BK1603

comment created time in 6 days

Pull request review commentneovim/neovim

[WIP] fswatch autoread

+-- Create a file watcher, each watcher is identified by the name of the file that it+-- watches.++local uv = vim.loop+local Watcher = {}+local w = {}+local WatcherList = {}+local commence = nil++--- Callback for the check handle, checks if there are pending notifications+--- for any watcher, and handles them as per the value of the `fcnotify`+--- option.+local function check_notifications()+  for _, watcher in pairs(WatcherList) do+    local option = vim.api.nvim_buf_get_option(watcher.bufnr, 'filechangenotify')+    if watcher.pending_notifs and watcher.paused == false and option ~= 'off' then+      if uv.fs_stat(watcher.ffname) ~= nil then+        vim.api.nvim_command('checktime '..watcher.bufnr)+        watcher.pending_notifs = false+      else+        error("ERR: File "..watcher.fname.." removed")+      end+    end+  end+end++--- Checks if a buffer should have a watcher attached to it.+--- Ignores all the buffers that aren't listed, or have a buf id+--- less than 0.+--- Ignores the [NO NAME] buffer.+---+--@param fname: The validity of this buffer will be checked.+local function valid_buf(fname)+  if fname == '' then+    return false+  end++  local bufnr = vim.api.nvim_call_function('bufnr', {fname})++  if bufnr < 0 then+    return false+  end++  local buflisted = vim.api.nvim_buf_get_option(bufnr, 'buflisted')+  local buftype = vim.api.nvim_buf_get_option(bufnr, 'buftype')++  if not buflisted or buftype == 'nofile' or buftype == 'quickfix' then+    return false+  end+  return true+end++local check_handle = uv.new_check()+check_handle:start(vim.schedule_wrap(check_notifications))++--- Creates and initializes a new watcher object with the given filename.+---+--@param fname: (required, string) The path that the watcher should watch.+function Watcher:new(fname)+  vim.validate{fname = {fname, 'string', false}}+  -- get full path name for the file+  local ffname = vim.api.nvim_call_function('fnamemodify', {fname, ':p'})+  w = {bufnr = vim.api.nvim_call_function('bufnr', {fname}),+       fname = fname, ffname = ffname, handle = nil,+       paused = false, pending_notifs = false}+  setmetatable(w, self)+  self.__index = self+  return w+end++local function start_poll(fname)+  WatcherList[fname].handle = uv.new_fs_poll()+  WatcherList[fname].handle:start(WatcherList[fname].ffname, 200, function(...)+    WatcherList[fname]:poll_change(...)+  end)+end++--- Starts the watcher+---+--@param self: (required, table) The watcher object on which start was called.+local function start_watch(fname)+  WatcherList[fname].handle = uv.new_fs_event()+  WatcherList[fname].handle:start(WatcherList[fname].ffname, {}, function(...)+    WatcherList[fname]:watch_change(...)+  end)+end++function Watcher:start()+  if self.handle and not self.handle:is_closing() then+    self.handle:close()+  end++  commence(self.fname)+end++function Watcher.init_poll()+  commence = start_poll+end++function Watcher.init_watcher()+  commence = start_watch+end++--- Stops the watcher and closes the handle.+---+--@param self: (required, table) The watcher object on which stop was called.+function Watcher:stop()+  self.handle:stop()++  -- close the handle altogether, for windows.+  if self.handle:is_closing() then+    return+  end+  self.handle:close()+end++--- Callback for watcher handle. Marks a watcher as having pending+--- notifications. The nature of notification is determined while+--- responding to the notification.+---+--@param err: (string) Error if any occured during the execution of the callback.+---+--@param fname: (string) The file for which the notification was received. (Not+---             very reliable.)+---+--@param event: (table) The type of event recieved for a file.+function Watcher:watch_change(err, fname, event)+  -- To satisfy the lua linter.+  if fname == nil or event == nil then+    error("No fname found for callback")+  end++  if err ~= nil then+    error(err)+  end++  self.pending_notifs = true++  self:stop()+  self:start()+end++function Watcher:poll_change(err, prev, curr)+  if err ~= nil then+    error(err)+  end++  if prev.mtime.sec ~= curr.mtime.sec or+    prev.mtime.nsec ~= curr.mtime.nset then+    self.pending_notifs = true++    self:stop()+    self:start()+  end+end++--- Starts and initializes a watcher for the given path. A thin wrapper around+--- Watcher:start() that can be called from vimscript.+---+--@param fname: (required, string) The path that the watcher should watch.+function Watcher.start_watch(fname)+  if not valid_buf(fname) then+    return+  end++  if not commence then+    error('Handle not initialized, did you set a value for fcnotify?')+  end++  if WatcherList[fname] ~= nil then+    WatcherList[fname]:stop()+  end++  WatcherList[fname] = Watcher:new(fname)+  WatcherList[fname]:start()+end++--- Stops the watcher watching a given file and closes it's handle. A+--- thin wrapper around Watcher:stop() that can be called from vimscript.+---+--@param fname: (required, string) The path which is being watched.+function Watcher.stop_watch(fname)+  -- can't close watchers for certain buffers+  if not valid_buf(fname) then+    return+  end++  print(fname)+  -- shouldn't happen+  if WatcherList[fname] == nil then+    print(fname..' not exists')+    return+  end++  WatcherList[fname]:stop()+end++function Watcher:pause_notif()+  self.paused = true+end++function Watcher:resume_notif()+  self.paused = false+end++--- Stop reacting to notifications for all the watchers until we are+--- asked to start reacting again.+function Watcher.pause_notif_all()+  check_handle:stop()+end++--- Start reacting to notifications for all wathcers.+function Watcher.resume_notif_all()+  check_handle:start(vim.schedule_wrap(check_notifications))+end++function Watcher.print_all()

Will this be removed?

BK1603

comment created time in 6 days

Pull request review commentneovim/neovim

[WIP] fswatch autoread

+-- Create a file watcher, each watcher is identified by the name of the file that it+-- watches.++local uv = vim.loop+local Watcher = {}+local w = {}+local WatcherList = {}+local commence = nil++--- Callback for the check handle, checks if there are pending notifications+--- for any watcher, and handles them as per the value of the `fcnotify`+--- option.+local function check_notifications()+  for _, watcher in pairs(WatcherList) do+    local option = vim.api.nvim_buf_get_option(watcher.bufnr, 'filechangenotify')+    if watcher.pending_notifs and watcher.paused == false and option ~= 'off' then+      if uv.fs_stat(watcher.ffname) ~= nil then+        vim.api.nvim_command('checktime '..watcher.bufnr)+        watcher.pending_notifs = false+      else+        error("ERR: File "..watcher.fname.." removed")+      end+    end+  end+end++--- Checks if a buffer should have a watcher attached to it.+--- Ignores all the buffers that aren't listed, or have a buf id+--- less than 0.+--- Ignores the [NO NAME] buffer.+---+--@param fname: The validity of this buffer will be checked.+local function valid_buf(fname)+  if fname == '' then+    return false+  end++  local bufnr = vim.api.nvim_call_function('bufnr', {fname})++  if bufnr < 0 then+    return false+  end++  local buflisted = vim.api.nvim_buf_get_option(bufnr, 'buflisted')+  local buftype = vim.api.nvim_buf_get_option(bufnr, 'buftype')++  if not buflisted or buftype == 'nofile' or buftype == 'quickfix' then+    return false+  end+  return true+end++local check_handle = uv.new_check()+check_handle:start(vim.schedule_wrap(check_notifications))++--- Creates and initializes a new watcher object with the given filename.+---+--@param fname: (required, string) The path that the watcher should watch.+function Watcher:new(fname)+  vim.validate{fname = {fname, 'string', false}}+  -- get full path name for the file+  local ffname = vim.api.nvim_call_function('fnamemodify', {fname, ':p'})+  w = {bufnr = vim.api.nvim_call_function('bufnr', {fname}),+       fname = fname, ffname = ffname, handle = nil,+       paused = false, pending_notifs = false}+  setmetatable(w, self)+  self.__index = self+  return w+end++local function start_poll(fname)+  WatcherList[fname].handle = uv.new_fs_poll()+  WatcherList[fname].handle:start(WatcherList[fname].ffname, 200, function(...)+    WatcherList[fname]:poll_change(...)+  end)+end++--- Starts the watcher+---+--@param self: (required, table) The watcher object on which start was called.+local function start_watch(fname)+  WatcherList[fname].handle = uv.new_fs_event()+  WatcherList[fname].handle:start(WatcherList[fname].ffname, {}, function(...)+    WatcherList[fname]:watch_change(...)+  end)+end++function Watcher:start()+  if self.handle and not self.handle:is_closing() then+    self.handle:close()+  end++  commence(self.fname)+end++function Watcher.init_poll()+  commence = start_poll+end++function Watcher.init_watcher()+  commence = start_watch+end++--- Stops the watcher and closes the handle.+---+--@param self: (required, table) The watcher object on which stop was called.+function Watcher:stop()+  self.handle:stop()++  -- close the handle altogether, for windows.+  if self.handle:is_closing() then+    return+  end+  self.handle:close()+end++--- Callback for watcher handle. Marks a watcher as having pending+--- notifications. The nature of notification is determined while+--- responding to the notification.+---+--@param err: (string) Error if any occured during the execution of the callback.+---+--@param fname: (string) The file for which the notification was received. (Not+---             very reliable.)+---+--@param event: (table) The type of event recieved for a file.+function Watcher:watch_change(err, fname, event)+  -- To satisfy the lua linter.

You can just put the param name as _ to silence warnings about unused args if you don't want them.

BK1603

comment created time in 6 days

Pull request review commentneovim/neovim

[WIP] fswatch autoread

 did_set_string_option(     if (check_ei() == FAIL) {       errmsg = e_invarg;     }+  } else if (gvarp == &p_fcnotify) {  // 'filechangenotify'+    if (check_opt_strings(curbuf->b_p_fcnotify, p_fcn_values, true) != OK) {+      errmsg = e_invarg;+    } else {+      // TODO(BK1603): Why do tests don't respect local buffer?+      if (strstr((char *)curbuf->b_p_fcnotify, "watcher") != NULL) {+        do_cmdline((char_u *)"call v:lua.vim.fcnotify.init_watcher()", NULL, NULL, 0);

You can execute this directly in Lua if you want.

This should also be "private" (leading underscore) if they should only be called fro core.

BK1603

comment created time in 6 days

pull request commentneovim/neovim

Add buffer information to tabline_update

@teto , @jamessan or @norcalli I don't know how to proceed on this one -- not as familiar w/ the external API as a consumer.

Mayb3 @norcalli knows since he is working on his own gui ;)

jgehrig

comment created time in 6 days

Pull request review commentnvim-treesitter/nvim-treesitter

feat(predicates): is predicate

 function M.containing_scope(node, bufnr)     iter_node = iter_node:parent()   end -  return iter_node or node+  return iter_node or nil

(and you could call it with false passed)

steelsojka

comment created time in 6 days

Pull request review commentnvim-treesitter/nvim-treesitter

feat(predicates): is predicate

 function M.containing_scope(node, bufnr)     iter_node = iter_node:parent()   end -  return iter_node or node+  return iter_node or nil

You could add third parameter allow_scope or something similar. if nil or true, then you return the node, else you just retun nil at the end.

steelsojka

comment created time in 6 days

pull request commentwbthomason/packer.nvim

[WIP] Lua Rocks

I can try and clean up the PR soon and we can merge v1 support of it? What do you think?

tjdevries

comment created time in 6 days

pull request commentwbthomason/packer.nvim

[WIP] Lua Rocks

I wouldn't be worried about the big comment block about switching back... that's primrily about trying to do luarocks from a module, which may not be possible.

tjdevries

comment created time in 6 days

Pull request review commentwbthomason/packer.nvim

[WIP] Lua Rocks

+package.loaded['packer.util'] = nil+package.loaded['packer.neorocks'] = nil+package.loaded['packer.window'] = nil++local a      = require('packer.async')+local jobs   = require('packer.jobs')+local log    = require('packer.log')+local result = require('packer.result')+local util   = require('packer.util')+local window = require('packer.window')++local await = a.wait+local async = a.sync++local neorocks = {}++---@return table Of the form: {+---     lua: Lua Version (5.1, 5.2, etc.)+---     jit: Jit Version (2.1.0-beta3, or nil)+---     dir: Directory of hererocks installation+--- }+neorocks._lua_version = (function()+  if jit then+    return {+      lua = string.gsub(_VERSION, "Lua ", ""),+      jit = string.gsub(jit.version, "LuaJIT ", ""),+      dir = string.gsub(jit.version, "LuaJIT ", "")+    }+  end++  error("NEOROCKS: Unsupported Lua Versions", _VERSION)+end)()++neorocks._base_path = util.join_paths(vim.fn.stdpath('cache'), 'packer_hererocks')+neorocks._hererocks_file = util.join_paths(vim.fn.stdpath('cache'), 'hererocks.py')+neorocks._hererocks_install_location = util.join_paths(neorocks._base_path, neorocks._lua_version.dir)+neorocks._is_setup = vim.fn.isdirectory(util.join_paths(neorocks._hererocks_install_location, "lib")) > 0++--- Determine if the hererocks environment is usable for nvim+---+---@return boolean True if the hererocks environment is already set up+neorocks.is_setup = function()+  return neorocks._is_setup+end++neorocks.get_hererocks = async(function()+  local url_loc = 'https://raw.githubusercontent.com/luarocks/hererocks/latest/hererocks.py'++  local cmd+  if vim.fn.executable('curl') > 0 then+    cmd = string.format(+      'curl %s -o %s',+      url_loc,+      util.absolute_path(neorocks._hererocks_file)+    )+  elseif vim.fn.executable('wget') > 0 then+    cmd = string.format(+      'wget %s -O %s --verbose',+      url_loc,+      util.absolute_path(neorocks._hererocks_file)+    )+  else+    error('"curl" or "wget" is required to install hererocks')+  end++  local r = result.ok(true)+  return r:and_then(+      await, jobs.run(cmd, {})+    ):map_err(+      function(err)+        return {+          msg = "Failed to get hererocks",+          data = err+        }+      end+    ):map_ok(+      function(ok)+        return {+          status = ok,+          -- TODO: Figure out what we should be doing with the output+          -- output = output+        }+      end+    )+end)++--- Handle the set up of luarocks+neorocks.setup_hererocks = async(function(force)+  if force == nil then+    force = false+  end++  local r = result.ok(true)+  if not util.path_exists(neorocks._hererocks_file) then+    r:and_then(await, neorocks.get_hererocks)+  end++  if neorocks.is_setup() and not force then+    return+  end+++  local cmd+  if neorocks._lua_version.jit then+    cmd = string.format(+      "python %s --verbose -j %s -r %s %s",+      neorocks._hererocks_file,+      neorocks._lua_version.jit,+      "latest",+      neorocks._hererocks_install_location+    )+  else+    error("Only works for lua jit right now")+  end++  local opts = {capture_output = jobs.floating_term_table(nil, nil, "Luarocks Installation")}+  -- local opts = {}++  return r:and_then(+      await, jobs.run(cmd, opts)+    ):map_err(+      function(err)+        return {+          msg = "Failed to get hererocks",+          data = err+        }+      end+    ):map_ok(+      function(ok)+        neorocks._is_setup = true++        return {+          status = ok,+          -- TODO: Figure out what we should be doing with the output+          -- output = output+        }+      end+    )+end)++neorocks._get_package_paths = function()+  local lua_version = neorocks._lua_version+  local install_location = neorocks._hererocks_install_location++  local install_path = util.join_paths(+    install_location,+    "lib",+    "luarocks",+    string.format("rocks-%s", lua_version.lua)+  )++  local share_path = util.join_paths(+    install_location,+    "share",+    "lua",+    lua_version.lua+  )++  local gen_pattern = function(directory)+    return string.format(+    "%s/?.lua;%s/&/init.lua",+    directory,+    directory+  )+  end++  return gen_pattern(share_path) .. ';' .. gen_pattern(install_path)+end++neorocks.setup_paths = function(force)+  local lua_version = neorocks._lua_version+  local install_location = neorocks._hererocks_install_location++  local match_install_path = neorocks._get_package_paths()++  if force or not string.find(package.path, match_install_path, 1, true) then+    package.path = match_install_path .. ';' .. package.path+  end++  local install_cpath = util.join_paths(install_location, "lib", "lua", lua_version.lua)+  local match_install_cpath = string.format("%s/?.so", install_cpath)++  if force or not string.find(package.cpath, match_install_cpath, 1, true) then+    package.cpath = match_install_cpath .. ';' .. package.cpath+  end+end++-- activate hererocks based on current $SHELL+local function source_activate(install_location, activate_file)+  return string.format('source %s', util.join_paths(install_location, 'bin', activate_file))+end++neorocks._source_string = function(install_location)+  local user_shell = os.getenv("SHELL")+  local shell = user_shell:gmatch("([^/]*)$")()+  if shell == "fish" then+    return source_activate(install_location, 'activate.fish')+  elseif shell == "csh" then+    return source_activate(install_location, 'activate.csh')+  end+  return source_activate(install_location, 'activate')+end++-- neorocks.get_async_installer = function(rocks, plugin_name, display)+--   return async(function(self)+    -- local new_env = setmetatable({}, {+    --   __index = function(t, k)+    --     local val+    --     if k == 'io' then+    --       val = setmetatable({+    --         stdout = { write = function(_, s) display:task_update(plugin_name, string.format('stdout: %s', s)) end, },+    --         stderr = { write = function(_, s) display:task_update(plugin_name, string.format('stderr: %s', s)) end, },+    --       }, { __index = function() error('ACCESSING IO') end })+    --     elseif k == 'os' then+    --       val = setmetatable({exit = function() error('OS.EXIT') end}, {__index = os})+    --     elseif k == 'print' then+    --       val = function(...)+    --         display:task_update(plugin_name, vim.inspect({...}))+    --       end+    --     else+    --       val = _G[k]+    --     end++    --     t[k] = val+    --     return t[k]+    --   end+    -- })++    -- -- Install the package+    -- local exec_luarocks = loadfile(util.join_paths(neorocks._hererocks_install_location, "bin", "luarocks"))+    -- -- Redirect io.stdout & io.stderr+    -- setfenv(exec_luarocks, new_env)('install', rocks[1])++    -- TODO: I would really like to go back to the loadfile method and not shoot this out to a shell...

Ah, I added half of this already but forgot to use $SHELL in the actual command. Yup, good call.

tjdevries

comment created time in 6 days

Pull request review commentwbthomason/packer.nvim

[WIP] Lua Rocks

 packer.install = function(...)       await(a.main)       plugin_utils.update_helptags(install_paths)       plugin_utils.update_rplugins()-      local delta = string.gsub(vim.fn.reltimestr(vim.fn.reltime(start_time)), ' ', '')-      display_win:final_results(results, delta)++      if not vim.tbl_isempty(results.rocks) then+        await(neorocks.install_rocks(results.rocks))+      else+        log.info("No rocks to install")+      end++      vim.schedule_wrap(function()

Hm, I'm still not sure I 100% understand what you're thinking for where to place it and how tht works. I'm fine w/ either you adding a commit to the branch or we just do it after (if it's not a big deal)

tjdevries

comment created time in 6 days

Pull request review commentwbthomason/packer.nvim

[WIP] Lua Rocks

 packer.install = function(...)       await(a.main)       plugin_utils.update_helptags(install_paths)       plugin_utils.update_rplugins()-      local delta = string.gsub(vim.fn.reltimestr(vim.fn.reltime(start_time)), ' ', '')-      display_win:final_results(results, delta)++      if not vim.tbl_isempty(results.rocks) then+        await(neorocks.install_rocks(results.rocks))

So I thinkg lua rocks itself already handles the fact that when you remove one package it cleans up the deps of the package (if no one else is using it). But I haven't followed up on that. We can always add that as an enhancement later (since I think our implementation may get a little more complicated over time :laughing: )

tjdevries

comment created time in 6 days

issue commentwbthomason/packer.nvim

Install freezes if not a valid git repository

(I ended up just instaling ubuntu on my laptop because I was having some troubles with WSL... so it may be awhile before I get around to testing this :laughing: ) Not a high priority for me and user error in some ways anyway ;)

tjdevries

comment created time in 6 days

issue commentneovim/neovim

Source lua files from plugin directories

I can't remember if we said that it should take priority over .vim files or just source side-by-side?

plugin/my_plug.vim and plugin/my_plug.lua should both be sourced? (it seems yes, because they get sourced in other directories, and it's not like startup where there is always only "one" startup file).

clason

comment created time in 6 days

issue commentneovim/pynvim

Buffer class makes unexpected RPC calls

Are there any circumstances that you would the buffer to be false-y?

I think it seems reasonable to override __bool__. It seems unlikely to break anything? Unless it returns false when there are no lines and people are relying on that.

ms-jpq

comment created time in 6 days

issue commentkdheepak/lazygit.nvim

Do you think it'd be possible to open the commit editor via nvr in a floating window as well?

Well I don't like using the embedded nvim inside of the terminal (because sometimes I press esc to the wrong thing or stuff like that). You can ignore the request though, was just wondering if it was possible because I like floating windows. No big reason :laughing:

tjdevries

comment created time in 6 days

pull request commentneovim/nvim-lsp

Switch to Lua on_exit callback in util.sh

We can probably merge this in a little while, I want to give more people time to update master (it's a bit annoying for them if they don't update regularly). Also just making sure we haven't miss anything w/ the Lua callbacks.

Ping me in a few weeks or something and we can merge (unless someone wants to merge sooner, then that is fine w/ me)

dlukes

comment created time in 6 days

issue commentneovim/neovim

vim/treesitter.lua:191: invalid end error rendered as virtual text

(if possible, tailoring tests to something similar to bug reports we've had)

sanga

comment created time in 6 days

issue commentneovim/neovim

vim/treesitter.lua:191: invalid end error rendered as virtual text

I would suggest we just try and write one million tests for the feature in the PR (if you're still intereseted in doing that)

sanga

comment created time in 6 days

issue commentneovim/neovim

vim/treesitter.lua:191: invalid end error rendered as virtual text

@vigoux Is there anything we have in progress to fix this / anything you need help on? i don't know if @norcalli is interested in this at all.

sanga

comment created time in 6 days

issue commentneovim/neovim

init.lua as an alternative to init.vim

So perhaps init-file init-vim init-lua all explained in one paragraph, with their ordering and relationships? That seems good to me. Going forward we should use init-file as the general purpose marker, but I'm not sure we 100% need to find every place of init-vim at this point? @teto what do you think of that?

justinmk

comment created time in 6 days

pull request commentneovim/neovim

[RFC] man.vim: Add - to 'iskeyword'

Thanks, LGTM

nhooyr

comment created time in 6 days

push eventneovim/neovim

Anmol Sethi

commit sha 7f49594813287d8134c52b3a9ee8ff099d525468

man.vim: Add - to 'iskeyword' (#12598) Pressing K on manpages with - in their name will now work. I noticed this the manpages of https://github.com/cli/cli

view details

push time in 6 days

PR merged neovim/neovim

[RFC] man.vim: Add - to 'iskeyword'

Pressing K on manpages with - in their name will now work.

I noticed this the manpages of https://github.com/cli/cli

+1 -0

7 comments

1 changed file

nhooyr

pr closed time in 6 days

issue commentkdheepak/lazygit.nvim

Suggestion: Check for `nvr` and auto add `.vimrc` updates

Hmm... maybe this request doesn't make sense. Let me try it out for longer and I'll let you know if I run into anything.

tjdevries

comment created time in 6 days

pull request commentneovim/nvim-lsp

[RFC] don't start up LSP for 'nofile' buffers

OK, I think the reasoning makes sense there. We can always upstream an additional thing if we want to.

@norcalli / @h-michael are either of you good with this?

beardedsakimonkey

comment created time in 6 days

pull request commentneovim/neovim

LSP: Feature/add workspace folders

Could use a test at least asserting that we are going to send the message to a client (for both adding and removing a worksapce). You don't have to see if the client conforms or anything like that. Do you need help setting up the tet?

mjlbach

comment created time in 6 days

Pull request review commentneovim/neovim

LSP: Feature/add workspace folders

 function M.make_text_document_params()   return { uri = vim.uri_from_bufnr(0) } end +function M.make_workspace_params()

This could take added and removed as params, and then if they are nil, do empty tables.

mjlbach

comment created time in 6 days

Pull request review commentneovim/neovim

LSP: Feature/add workspace folders

 function protocol.resolve_capabilities(server_capabilities)     error("The server sent invalid implementationProvider")   end +  local workspace = server_capabilities.workspace+  if workspace == nil or workspace.workspaceFolders == nil then+    -- Defaults if omitted.+    workspace_properties = {+      workspace_folder_properties =  {+        supported = false;+        changeNotifications=false;+      }+    }+  elseif type(workspace.workspaceFolders) == 'table' then

I think you can tbl_deepextend for this or something like that maybe?

mjlbach

comment created time in 6 days

more