zk-org / zk-nvim

Neovim extension for zk
https://github.com/zk-org/zk
GNU General Public License v3.0
503 stars 41 forks source link

ZkNewFromTitleSelection should error when used with visual block selection #34

Closed roginfarrer closed 2 years ago

roginfarrer commented 2 years ago

Not sure if this is possible, but sometimes I get tripped up when using visual block selection (V) and the ZkNewFromTitleSelection command. Currently, a new note will be created called "Untitled", which will also replace the line with that string.

To reproduce:

  1. Write some character on a line, like "My New Note"
  2. Visually block select the whole line
  3. Execute the ZkNewFromTitleSelection command

Expected: a new note titled "My New Note". Instead you get "Untitled".

If it can work, that's awesome, otherwise I think some kind of error should be thrown, and the new note should not be created.

kabouzeid commented 2 years ago

Good catch, thanks for reporting. This was because of undocumented behavior in LuaJIT.