def WriteToPreviewWindow(message):
 ClosePreviewWindow()
 OpenFileInPreviewWindow(vim.eval(u'tempname()'))
 if JumpToPreviewWindow():
  vim.current.buffer.options[u'modifiable'] = True
  vim.current.buffer.options[u'readonly'] = False
  vim.current.buffer[:] = message.splitlines()
  vim.current.buffer.options[u'buftype'] = u'nofile'
  vim.current.buffer.options[u'bufhidden'] = u'wipe'
  vim.current.buffer.options[u'buflisted'] = False
  vim.current.buffer.options[u'swapfile'] = False
  vim.current.buffer.options[u'modifiable'] = False
  vim.current.buffer.options[u'readonly'] = True
  vim.current.buffer.options[u'modified'] = False
  JumpToPreviousWindow()
 else:
  PostVimMessage(message, warning=False)

def WriteToPreviewWindow ( message ) : ClosePreviewWindow ( ) OpenFileInPreviewWindow ( vim . eval ( u'tempname()' ) ) if JumpToPreviewWindow ( ) : vim . current . buffer . options [ u'modifiable' ] = True vim . current . buffer . options [ u'readonly' ] = False vim . current . buffer [ : ] = message . splitlines ( ) vim . current . buffer . options [ u'buftype' ] = u'nofile' vim . current . buffer . options [ u'bufhidden' ] = u'wipe' vim . current . buffer . options [ u'buflisted' ] = False vim . current . buffer . options [ u'swapfile' ] = False vim . current . buffer . options [ u'modifiable' ] = False vim . current . buffer . options [ u'readonly' ] = True vim . current . buffer . options [ u'modified' ] = False JumpToPreviousWindow ( ) else : PostVimMessage ( message , warning = False )
display the supplied message in the preview window .