MCPcopy Index your code
hub / github.com/ycm-core/YouCompleteMe / TryJumpLocationInTab

Function TryJumpLocationInTab

python/ycm/vimsupport.py:623–637  ·  view source on GitHub ↗
( tab, filename, line, column )

Source from the content-addressed store, hash-verified

621
622# Both |line| and |column| need to be 1-based
623def TryJumpLocationInTab( tab, filename, line, column ):
624 for win in tab.windows:
625 if ComparePaths( GetBufferFilepath( win.buffer ), filename ):
626 vim.current.tabpage = tab
627 vim.current.window = win
628 if line is not None and column is not None:
629 vim.current.window.cursor = ( line, column - 1 )
630 # Open possible folding at location
631 vim.command( 'normal! zv' )
632 # Center the screen on the jumped-to location
633 vim.command( 'normal! zz' )
634
635 return True
636 # 'filename' is not opened in this tab page
637 return False
638
639
640# Both |line| and |column| need to be 1-based

Callers 2

TryJumpLocationInTabsFunction · 0.85
JumpToLocationFunction · 0.85

Calls 2

ComparePathsFunction · 0.85
GetBufferFilepathFunction · 0.85

Tested by

no test coverage detected