Index: tools/vim/chromium.ycm_extra_conf.py |
diff --git a/tools/vim/chromium.ycm_extra_conf.py b/tools/vim/chromium.ycm_extra_conf.py |
index f26d4beae4af03e0a1ebb537b912d1acdfd90f92..e5396e3b19b756f071032d4ee0dd7f543ede2151 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), |
eroman
2014/08/29 19:23:22
much nicer!
|
+ 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 + '^'], |