From 9b5960f81e8660aabf31f0edd62e5042334c2e91 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Wed, 22 Jan 2020 21:34:32 +0000 Subject: [PATCH] Fix go language server returning 0 column causing errors in neovim --- python3/vimspector/code.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python3/vimspector/code.py b/python3/vimspector/code.py index b1b7698..27d9586 100644 --- a/python3/vimspector/code.py +++ b/python3/vimspector/code.py @@ -75,8 +75,10 @@ class CodeView( object ): return False # SIC: column is 0-based, line is 1-based in vim. Why? Nobody knows. + # Note: max() with 0 because some debug adapters (go) return 0 for the + # column. try: - self._window.cursor = ( frame[ 'line' ], frame[ 'column' ] - 1 ) + self._window.cursor = ( frame[ 'line' ], max( frame[ 'column' ] - 1, 0 ) ) except vim.error: self._logger.exception( "Unable to jump to %s:%s in %s, maybe the file " "doesn't exist",