parameters: (self, target, controller)
docstring: updates buffer contents
docstring_summary: updates buffer contents
docstring_tokens: updates buffer contents
function: def update(self, target, controller):
          """ updates buffer contents """
          self.target = target
          if not self.isPrepared():
              # Window is hidden, or otherwise not ready for an update
              return
  
          original_cursor = self.window.cursor
  
          # Select pane
          goto_window(bufwinnr(self.name))
  
          # Clean and update content, and apply any highlights.
          self.clean()
  
          if self.write(self.get_content(target, controller)):
              self.apply_highlights()
  
              cursor = self.get_selected_line()
              if cursor is None:
                  # Place the cursor at its original position in the window
                  cursor_line = min(original_cursor[0], len(self.buffer))
                  cursor_col = min(
                      original_cursor[1], len(
                          self.buffer[
                              cursor_line - 1]))
              else:
                  # Place the cursor at the location requested by a VimPane
                  # implementation
                  cursor_line = min(cursor, len(self.buffer))
                  cursor_col = self.window.cursor[1]
  
              self.window.cursor = (cursor_line, cursor_col)
  
          goto_previous_window()
function_tokens: def update ( self , target , controller ) : self . target = target if not self . isPrepared ( ) : # Window is hidden, or otherwise not ready for an update return original_cursor = self . window . cursor # Select pane goto_window ( bufwinnr ( self . name ) ) # Clean and update content, and apply any highlights. self . clean ( ) if self . write ( self . get_content ( target , controller ) ) : self . apply_highlights ( ) cursor = self . get_selected_line ( ) if cursor is None : # Place the cursor at its original position in the window cursor_line = min ( original_cursor [ 0 ] , len ( self . buffer ) ) cursor_col = min ( original_cursor [ 1 ] , len ( self . buffer [ cursor_line - 1 ] ) ) else : # Place the cursor at the location requested by a VimPane # implementation cursor_line = min ( cursor , len ( self . buffer ) ) cursor_col = self . window . cursor [ 1 ] self . window . cursor = ( cursor_line , cursor_col ) goto_previous_window ( )