From Andrey Popp to ~detegr/nvim-bqn
This work arounds another bug with neovim virtual lines: when we update output for a line and the new output contains less lines than previously neovim behaves weird (the previous output is not cleared properly). The redraw command at the end of an update fixes this so neovim properly redraws the grid. --- lua/bqn.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/bqn.lua b/lua/bqn.lua index e414b1f..bcf6dc9 100644 --- a/lua/bqn.lua +++ b/lua/bqn.lua [message trimmed]
From Andrey Popp to ~detegr/nvim-bqn
Once we see an error returned from CBQN we set diagnostics via `vim.diagnostic` API. This helps to see which line contains the error. The diagnostic set is "ephemeral" as it will be cleared (or replaced with another one) once we eval another piece of code. --- Let me know what you think! I've found this useful to quickly find an offending line. Would be cool if CBQN reported a column as well... lua/bqn.lua | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/lua/bqn.lua b/lua/bqn.lua [message trimmed]
From Andrey Popp to ~detegr/nvim-bqn
This changes command names to be prefixed with `:BQN` for better
discovery (completion in command mode).
Then this introduces plug mappings and automatically maps them to
- `<CR>` evals, till the line (or range), as previously
- `<leader>bf` evals the whole file
- `<leader>bc` clears output after the line (or range)
---
The changes as we've discussed before.
I didn't map `<plug>(bqn_clear_file)` here as I'm not sure what would be the
best key for that, was thinking of `<leader>bcf` but then it introduces a delay
[message trimmed]
From Andrey Popp to ~detegr/nvim-bqn
Hi, On Sun Dec 5, 2021 at 10:35 AM MSK, Antti Keränen wrote: > On Sat, Dec 04, 2021 at 05:16:00PM +0300, Andrey Popp wrote: > > The set of available command has changed, first we have the following > > commands to eval BQN expressions: > > > > :EvalBQNTillLine > > :EvalBQNRange > > :EvalBQNFile > > > > and then a set of commands to clear output: > > > > :ClearBQNAfterLine
From Andrey Popp to ~detegr/nvim-bqn
This commit makes nvim-bqn use virtual lines feature of neovim 0.6.0
show output of running BQN expressions.
The set of available command has changed, first we have the following
commands to eval BQN expressions:
:EvalBQNTillLine
:EvalBQNRange
:EvalBQNFile
and then a set of commands to clear output:
:ClearBQNAfterLine
:ClearBQNRange
[message trimmed]
From Andrey Popp to ~detegr/nvim-bqn
Ah, forgot about another thing — this patch changes how it determines what to eval — it always sends code from the start of the buffer to the current `to`. I actually think this is a good thing when you just press Enter (you really want all previously defined bindings to be available) but for visual mode — maybe it should send exactly what was selected... -- Andrey Popp / 8mayday@gmail.com
From Andrey Popp to ~detegr/nvim-bqn
Neovim 0.6.0 was recently released and has added a new feature called virtual lines. This allows to attach a set of "out-of-buffer" lines to some locations via extmark mechanism. This patch changes how output is shown - instead of making a separate split buffer it shows computed value as a set of virtual lines attached to the "end" of the computed region. --- This adds some comments describing why something being done. lua/bqn.lua | 70 ++++++++++++++++++++++++----------------------------- 1 file changed, 32 insertions(+), 38 deletions(-) diff --git a/lua/bqn.lua b/lua/bqn.lua [message trimmed]
From Andrey Popp to ~detegr/nvim-bqn
Neovim 0.6.0 was recently released and has added a new feature called virtual lines. This allows to attach a set of "out-of-buffer" lines to some locations via extmark mechanism. This patch changes how output is shown - instead of making a separate split buffer it shows computed value as a set of virtual lines attached to the "end" of the computed region. See https://twitter.com/andreypopp/status/1466543075925188612 for the example of how it looks. Thanks for the plugin! --- lua/bqn.lua | 65 +++++++++++++++++++++++------------------------------ [message trimmed]