DRY
authorSergey Matveev <stargrave@stargrave.org>
Sat, 6 Feb 2021 12:12:10 +0000 (15:12 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sat, 6 Feb 2021 12:12:10 +0000 (15:12 +0300)
vim/.vim/plugin/file_line.vim

index c1544a19c503f357efef833ae29621000ee494d2..45e250ea59db2839658a25f59c126eb3dd5dd1c3 100644 (file)
@@ -7,7 +7,7 @@ let g:loaded_mein_file_line = 1
 function! s:gotoline()
     let file = bufname("%")
     if filereadable(file) | return | endif
-    let names = matchlist(bufname("%"), '\(.\{-1,}\):\%(\(\d\+\)\%(:\(\d*\):\?\)\?\)\?$')
+    let names = matchlist(file, '\(.\{-1,}\):\%(\(\d\+\)\%(:\(\d*\):\?\)\?\)\?$')
     if empty(names) | return | endif
     let file_name = names[1]
     let line_num = names[2] == "" ? "0" : names[2]