Comments (8)
I do wonder if using this code would work better for you? #14
Since it's been merged in, not sure when (if not already) it'll be set for release.
from zk-nvim.
I do wonder if using this code would work better for you? #14
Since it's been merged in, not sure when (if not already) it'll be set for release.
I think I'm already at the latest commit on main, which is one commit ahead of #14. And yet the problem persists, I'm not sure if the problem is caused by #14. Would you like me to try commits before its merge to see if the issue is present then as well?
from zk-nvim.
If you were trying this via your N mapping. This mapping
vim.api.nvim_set_keymap("v", "N", ":ZkNewFromTitleSelection<CR>", { noremap = true })
should be
vim.api.nvim_set_keymap("v", "N", ":'<'>ZkNewFromTitleSelection<CR>", { noremap = true })
.
The '<'>
is important here, Neovim will only update these marks after you leave visual mode. This makes sure to leave visual mode before executing the command.
Just to be sure: First you make a selection, and then hit : which should automatically insert :'<,'>
for you, and the you complete this to :'<,'>ZkNewFromTitleSelection
and hit enter. Is this what you're doing?
from zk-nvim.
y
If you were trying this via your N mapping. This mapping
vim.api.nvim_set_keymap("v", "N", ":ZkNewFromTitleSelection<CR>", { noremap = true })
should bevim.api.nvim_set_keymap("v", "N", ":'<'>ZkNewFromTitleSelection<CR>", { noremap = true })
.The
'<'>
is important here, Neovim will only update these marks after you leave visual mode. This makes sure to leave visual mode before executing the command.
oh yeah, I actually changed that, just because I saw that it was repeated in the cmdline, just to see if it had anything to do with my problem. However, no tangible difference was made.
Just to be sure: First you make a selection, and then hit : which should automatically insert
:'<,'>
for you, and the you complete this to:'<,'>ZkNewFromTitleSelection
and hit enter. Is this what you're doing?
Exactly. I have also tried differnet combinations of keymappings to invoke this function. Again, nothing substantial was changed.
I sometimes get lucky and the function executes correctly, but I am yet to pin-point the effective parameter.
from zk-nvim.
Just trying to pin this down; does it maybe work if you make a selection, then hit esc to go back to normal mode first, then manually type :'<,'>ZkNewFromTitleSelection
?
from zk-nvim.
ok so I tracked it down now. there is a bug in this neovim 0.6.1 function (https://github.com/neovim/neovim/blob/b4fbb9dcf2752d95b9be335d99b0c55efb5f17de/runtime/lua/vim/lsp/util.lua#L193), which causes vim.lsp.util.make_given_range_params()
to not always return the correct value on unsaved buffers.
I've made a workaround PR which fixes this on our side (https://github.com/mickael-menu/zk-nvim/pull/20/files), but I'll also create an issue/PR at Neovim to properly fix this on their side when I get time.
from zk-nvim.
Thanks for reporting! I was previously testing this with Neovim 0.6.0 where the bug is not present.
from zk-nvim.
I've reported this bug upstream. neovim/neovim#16985
from zk-nvim.
Related Issues (20)
- How would one search for notes matching at least one tag in a list of options, but not necessarily all of them? HOT 1
- Support for, or how to go about replicating zk with fzf-lua instead of fzf.vim/fzf proper HOT 3
- Error during insertion of links HOT 3
- Can't get it to work HOT 2
- Looking for something like ZkOpen -- but only limited to current open buffers HOT 2
- Typo: nvim_add_user_command HOT 1
- Escape lua `special characters` in path name HOT 2
- Create a new note from selection without changing the selected text HOT 1
- Issues with creating note from selection HOT 17
- Emulate `zk list -i` / `zk edit -i` in nvim
- Link incorrectly formated after completion HOT 11
- Bug: `ZkNewFromTitleSelection` does not copy the last character correctly. HOT 1
- Link completion does not work with non-latin zettel name HOT 1
- Can't search/filter the LSP completion candidates HOT 3
- Imitate `zk edit --interactive` HOT 2
- Make Lsp check link validity relative to note instead of notebook
- completion only works with autocomplete, not via manual trigger (nvim-cmp) HOT 3
- LSP can't find a notebook HOT 5
- Incorrect "not found" diagnostic HOT 4
- `vim.lsp.get_active_clients()` is Deprecated HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zk-nvim.