Skip to content

Commit 1f48b7d

Browse files
authored
Add git top-level path when adding cscope
Can't go to function definition because it's absolute path. So add top-level path of git when loading cscope.out. It assumes that cscope.out is in root of git repository.
1 parent 3c7ccd4 commit 1f48b7d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

plugin/quickr-cscope.vim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ function! s:autoload_db()
5858
call s:debug_echo('Database file found at: ' . db)
5959
let &csprg=g:quickr_cscope_program
6060
call s:debug_echo('Trying to add the database file for program: ' . g:quickr_cscope_program)
61-
silent! execute "cs add " . db
61+
let root_path = trim(system("git rev-parse --show-toplevel"))
62+
execute "cs add " . db . " " . root_path
6263
return 1
6364
else
6465
call s:debug_echo('Database file not found.')

0 commit comments

Comments
 (0)