agelessdummy / vimwiki

Automatically exported from code.google.com/p/vimwiki
0 stars 1 forks source link

:VimwikiBacklinks finds too much #379

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. in index.wiki, insert the word iNdeX somewhere (surrounded by spaces)
2. type :VimwikiBacklinks
3. type :lwindow

What is the expected output? What do you see instead?
I expected that only actual links to index.wiki are found by the command, 
instead every occurrence of the word "index", even in different case, is found.

What version of the product are you using? On what operating system?
Vimwiki 2.0.1

Please provide any additional information below.
vimwiki#base#backlinks() is the place to look for. Maybe the current 
implementation makes sense in some way, but I don't really get it.

Original issue reported on code.google.com by istjanic...@gmail.com on 12 Oct 2012 at 8:09

GoogleCodeExporter commented 8 years ago
Fixed in ra239dd4a4614.  Please try the latest dev sources ...

Original comment by stu.andrews on 12 Oct 2012 at 3:32

GoogleCodeExporter commented 8 years ago
Thank you, but... well, that fixes just the thing with the case. Now when 
entering the command there is still every occurrence of the word "index" found, 
not only *links* to index.wiki. Or is this what the command is supposed to do?

Original comment by istjanic...@gmail.com on 15 Oct 2012 at 7:42

GoogleCodeExporter commented 8 years ago
I thought about adding the surrounding [-brackets, but realized that some 
people may want to locate instances of a word where a link could be added.

As a quick fix, you could try this version (this will only find [[xxxx]] 
instances).

function! vimwiki#base#backlinks() "{{{
    execute 'lvimgrep "\[\['.
          \ expand("%:t:r").
          \ '\]\]\C" '. 
          \ escape(VimwikiGet('path').'**/*'.VimwikiGet('ext'), ' ')
endfunction "}}}

To search for all proper links, we could look at how they are found by 
VimwikiRenameLink ...

Original comment by stu.andrews on 16 Oct 2012 at 2:24

GoogleCodeExporter commented 8 years ago

Original comment by stu.andrews on 28 Dec 2012 at 5:10