Skip to content

Commit

Permalink
Replace call to vim.eval/command to vim python API.
Browse files Browse the repository at this point in the history
This is easier to read, and may be a bit faster.
  • Loading branch information
xavierd committed Jan 29, 2013
1 parent 8ab46da commit 3b91672
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugin/libclang.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def initClangComplete(clang_complete_flags, clang_compilation_database, \
# Get a tuple (fileName, fileContent) for the file opened in the current
# vim buffer. The fileContent contains the unsafed buffer content.
def getCurrentFile():
file = "\n".join(vim.eval("getline(1, '$')"))
file = "\n".join(vim.current.buffer[:])
return (vim.current.buffer.name, file)

class CodeCompleteTimer:
Expand All @@ -96,7 +96,7 @@ def __init__(self, debug, file, line, column, params):
if not debug:
return

content = vim.eval("getline('.')");
content = vim.current.line
print " "
print "libclang code completion"
print "========================"
Expand Down Expand Up @@ -432,7 +432,7 @@ def getCurrentCompletions(base):
global debug
debug = int(vim.eval("g:clang_debug")) == 1
sorting = vim.eval("g:clang_sort_algo")
line = int(vim.eval("line('.')"))
line, _ = vim.current.window.cursor
column = int(vim.eval("b:col"))
params = getCompileParams(vim.current.buffer.name)

Expand Down

0 comments on commit 3b91672

Please sign in to comment.