MCPcopy Create free account
hub / github.com/ycm-core/YouCompleteMe / CurrentColumn

Function CurrentColumn

python/ycm/vimsupport.py:79–89  ·  view source on GitHub ↗

Returns the 0-based current column. Do NOT access the CurrentColumn in vim.current.line. It doesn't exist yet when the cursor is at the end of the line. Only the chars before the current column exist in vim.current.line.

()

Source from the content-addressed store, hash-verified

77
78
79def CurrentColumn():
80 """Returns the 0-based current column. Do NOT access the CurrentColumn in
81 vim.current.line. It doesn't exist yet when the cursor is at the end of the
82 line. Only the chars before the current column exist in vim.current.line."""
83
84 # vim's columns are 1-based while vim.current.line columns are 0-based
85 # ... but vim.current.window.cursor (which returns a (line, column) tuple)
86 # columns are 0-based, while the line from that same tuple is 1-based.
87 # vim.buffers buffer objects OTOH have 0-based lines and columns.
88 # Pigs have wings and I'm a loopy purple duck. Everything makes sense now.
89 return vim.current.window.cursor[ 1 ]
90
91
92def CurrentLineContents():

Callers 3

TextAfterCursorFunction · 0.85
TextBeforeCursorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected