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

Function JumpToFile

python/ycm/vimsupport.py:657–675  ·  view source on GitHub ↗
( filename, command, modifiers )

Source from the content-addressed store, hash-verified

655
656
657def JumpToFile( filename, command, modifiers ):
658 vim_command = GetVimCommand( command )
659 try:
660 escaped_filename = EscapeFilepathForVimCommand( filename )
661 vim.command(
662 f'keepjumps { modifiers } { vim_command } { escaped_filename }' )
663 # When the file we are trying to jump to has a swap file
664 # Vim opens swap-exists-choices dialog and throws vim.error with E325 error,
665 # or KeyboardInterrupt after user selects one of the options.
666 except vim.error as e:
667 if 'E325' not in str( e ):
668 raise
669 # Do nothing if the target file is still not opened (user chose (Q)uit).
670 if filename != GetCurrentBufferFilepath():
671 return False
672 # Thrown when user chooses (A)bort in .swp message box.
673 except KeyboardInterrupt:
674 return False
675 return True
676
677
678# Both |line| and |column| need to be 1-based

Callers 1

JumpToLocationFunction · 0.85

Calls 3

GetVimCommandFunction · 0.85
GetCurrentBufferFilepathFunction · 0.85

Tested by

no test coverage detected