| OLD | NEW |
| 1 " Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 " Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 " Use of this source code is governed by a BSD-style license that can be | 2 " Use of this source code is governed by a BSD-style license that can be |
| 3 " found in the LICENSE file. | 3 " found in the LICENSE file. |
| 4 " | 4 " |
| 5 " Adds a "Compile this file" function, using ninja. On Mac, binds Cmd-k to | 5 " Adds a "Compile this file" function, using ninja. On Mac, binds Cmd-k to |
| 6 " this command. | 6 " this command. |
| 7 " | 7 " |
| 8 " Requires that gyp has already generated build.ninja files, and that ninja is | 8 " Requires that gyp has already generated build.ninja files, and that ninja is |
| 9 " in your path (which it is automatically if depot_tools is in your path). | 9 " in your path (which it is automatically if depot_tools is in your path). |
| 10 " | 10 " |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 | 71 |
| 72 def set_makepgr_to_single_file_ninja(): | 72 def set_makepgr_to_single_file_ninja(): |
| 73 vim.command('let &makeprg="%s"' % compute_ninja_command()) | 73 vim.command('let &makeprg="%s"' % compute_ninja_command()) |
| 74 endpython | 74 endpython |
| 75 | 75 |
| 76 fun! CrCompileFile() | 76 fun! CrCompileFile() |
| 77 let l:oldmakepgr = &makeprg | 77 let l:oldmakepgr = &makeprg |
| 78 python set_makepgr_to_single_file_ninja() | 78 python set_makepgr_to_single_file_ninja() |
| 79 silent make | cwindow | 79 silent make | cwindow |
| 80 redraw! |
| 80 let &makeprg = l:oldmakepgr | 81 let &makeprg = l:oldmakepgr |
| 81 endfun | 82 endfun |
| 82 | 83 |
| 83 command! CrCompileFile call CrCompileFile() | 84 command! CrCompileFile call CrCompileFile() |
| 84 | 85 |
| 85 if has('mac') | 86 if has('mac') |
| 86 map <D-k> :CrCompileFile<cr> | 87 map <D-k> :CrCompileFile<cr> |
| 87 imap <D-k> <esc>:CrCompileFile<cr> | 88 imap <D-k> <esc>:CrCompileFile<cr> |
| 88 endif | 89 endif |
| 89 " TODO(linuxuser): Suggest a keyboard shortcut and send review to thakis@. | 90 " TODO(linuxuser): Suggest a keyboard shortcut and send review to thakis@. |
| OLD | NEW |