Пример #1
0
    def _OpenLogs(self, stdout=True, stderr=True):
        # Open log files in a horizontal window with the same behavior as the
        # preview window (same height and winfixheight enabled). Automatically
        # watch for changes. Set the cursor position at the end of the file.
        options = {
            'size': vimsupport.GetIntValue('&previewheight'),
            'fix': True,
            'watch': True,
            'position': 'end'
        }

        if stdout:
            vimsupport.OpenFilename(self._server_stdout, options)
        if stderr:
            vimsupport.OpenFilename(self._server_stderr, options)
Пример #2
0
def OpenFilename_test( vim_current, vim_command ):
  # Options used to open a logfile
  options = {
    'size': vimsupport.GetIntValue( '&previewheight' ),
    'fix': True,
    'watch': True,
    'position': 'end'
  }

  vimsupport.OpenFilename( __file__, options )

  vim_command.assert_has_exact_calls( [
    call( '12split {0}'.format( __file__ ) ),
    call( "exec "
          "'au BufEnter <buffer> :silent! checktime {0}'".format( __file__ ) ),
    call( 'silent! normal G zz' ),
    call( 'silent! wincmd p' )
  ] )

  vim_current.buffer.options.__setitem__.assert_has_exact_calls( [
    call( 'autoread', True ),
  ] )

  vim_current.window.options.__setitem__.assert_has_exact_calls( [
    call( 'winfixheight', True )
  ] )
Пример #3
0
    def _OpenLogfile(self, logfile):
        # Open log files in a horizontal window with the same behavior as the
        # preview window (same height and winfixheight enabled). Automatically
        # watch for changes. Set the cursor position at the end of the file.
        options = {
            'size': vimsupport.GetIntValue('&previewheight'),
            'fix': True,
            'focus': False,
            'watch': True,
            'position': 'end'
        }

        vimsupport.OpenFilename(logfile, options)