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.
()
| 77 | |
| 78 | |
| 79 | def 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 | |
| 92 | def CurrentLineContents(): |
no outgoing calls
no test coverage detected