Browse Source

Properly handle spaces in zettel ids

Changes the way gzn/edit_zettel_under_cursor selects text to be parsed
into zettel ids to allow for IDs with spaces in them

Fixes #6
virtual-titles
Noah Pederson 1 week ago
parent
commit
bc4af70983
1 changed files with 4 additions and 9 deletions
  1. +4
    -9
      autoload/neuron.vim

+ 4
- 9
autoload/neuron.vim View File

@ -218,17 +218,12 @@ func! neuron#edit_zettel_under_cursor()
echo "Waiting until cache is populated."
return
end
let l:zettel_id = trim(expand('<cword>'), "<>[]")
let l:prev = @p
execute 'normal! "pyi['
let l:zettel_id = @p
let @p = l:prev
if util#is_zettelid_valid(l:zettel_id)
call neuron#edit_zettel(l:zettel_id)
else
let l:zettel_id = trim(expand('<cWORD>'), "<>[]")
if util#is_zettelid_valid(l:zettel_id)
call neuron#edit_zettel(l:zettel_id)
else
echo 'Word under cursor is not a known zettel!'
endif
endif
endf


Loading…
Cancel
Save