summaryrefslogtreecommitdiffstats
path: root/tools/vim
diff options
context:
space:
mode:
authordzhioev <dzhioev@chromium.org>2014-08-29 16:08:21 -0700
committerCommit bot <commit-bot@chromium.org>2014-08-29 23:17:56 +0000
commit37accc2cd58a4f27f7cdd33907eae36f224bbb2e (patch)
treebbab87e7b59050b5092946f79c233063308a3170 /tools/vim
parente95c9e298410a846a8bf941833b6aa8357c5560a (diff)
downloadchromium_src-37accc2cd58a4f27f7cdd33907eae36f224bbb2e.zip
chromium_src-37accc2cd58a4f27f7cdd33907eae36f224bbb2e.tar.gz
chromium_src-37accc2cd58a4f27f7cdd33907eae36f224bbb2e.tar.bz2
YCM works correctly when 'out' directory is a symlink.
BUG=NONE TEST=manually NOTRY=true Review URL: https://codereview.chromium.org/519903002 Cr-Commit-Position: refs/heads/master@{#292709}
Diffstat (limited to 'tools/vim')
-rw-r--r--tools/vim/chromium.ycm_extra_conf.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/vim/chromium.ycm_extra_conf.py b/tools/vim/chromium.ycm_extra_conf.py
index f26d4be..e5396e3 100644
--- a/tools/vim/chromium.ycm_extra_conf.py
+++ b/tools/vim/chromium.ycm_extra_conf.py
@@ -38,6 +38,7 @@
import os
+import os.path
import subprocess
@@ -165,13 +166,13 @@ def GetClangCommandFromNinjaForFilename(chrome_root, filename):
# try to use the default flags.
return chrome_flags
- # Ninja needs the path to the source file from the output build directory.
- # Cut off the common part and /.
- subdir_filename = filename[len(chrome_root)+1:]
- rel_filename = os.path.join('..', '..', subdir_filename)
-
out_dir = GetNinjaOutputDirectory(chrome_root)
+ # Ninja needs the path to the source file relative to the output build
+ # directory.
+ rel_filename = os.path.relpath(os.path.realpath(filename),
+ os.path.realpath(out_dir))
+
# Ask ninja how it would build our source file.
p = subprocess.Popen(['ninja', '-v', '-C', out_dir, '-t',
'commands', rel_filename + '^'],