def Clear(self): with utils.ModifiableScratchBuffer(self._vars.buf): utils.ClearBuffer(self._vars.buf) with utils.ModifiableScratchBuffer(self._watch.buf): utils.ClearBuffer(self._watch.buf) self.ClearTooltip() self._current_syntax = ''
def _DrawThreads( self ): self._line_to_frame.clear() self._line_to_thread.clear() if self._current_thread_sign_id: signs.UnplaceSign( self._current_thread_sign_id, 'VimspectorStackTrace' ) else: self._current_thread_sign_id = 1 with utils.ModifiableScratchBuffer( self._buf ): with utils.RestoreCursorPosition(): utils.ClearBuffer( self._buf ) for thread in self._threads: icon = '+' if not thread.IsExpanded() else '-' line = utils.AppendToBuffer( self._buf, f'{icon} Thread {thread.id}: {thread.thread["name"]} ' f'({thread.State()})' ) if self._current_thread == thread.id: # TODO - Scroll the window such that this line is visible (e.g. at # the top) signs.PlaceSign( self._current_thread_sign_id, 'VimspectorStackTrace', 'vimspectorCurrentThread', self._buf.name, line ) self._line_to_thread[ line ] = thread self._DrawStackTrace( thread )
def Clear( self ): self._currentFrame = None self._currentThread = None self._threads = [] self._sources = {} with utils.ModifiableScratchBuffer( self._buf ): utils.ClearBuffer( self._buf )
def _DrawScopes(self): # FIXME: The drawing is dumb and draws from scratch every time. This is # simple and works and makes sure the line-map is always correct. # However it is pretty inefficient. self._vars.lines.clear() with utils.RestoreCursorPosition(): with utils.ModifiableScratchBuffer(self._vars.buf): utils.ClearBuffer(self._vars.buf) for scope in self._scopes: self._DrawScope(0, scope)
def _DrawScopes(self): # FIXME: The drawing is dumb and draws from scratch every time. This is # simple and works and makes sure the line-map is always correct. # However it is really inefficient, and makes it so that expanded results # are collapsed on every step. self._vars.lines.clear() with utils.RestoreCursorPosition(): with utils.ModifiableScratchBuffer(self._vars.win.buffer): utils.ClearBuffer(self._vars.win.buffer) for scope in self._scopes: self._DrawScope(0, scope)
def _DrawBalloonEval(self): watch = self._variable_eval view = self._variable_eval_view with utils.RestoreCursorPosition(): with utils.ModifiableScratchBuffer(view.buf): utils.ClearBuffer(view.buf) view.syntax = utils.SetSyntax(view.syntax, self._current_syntax, view.buf) self._DrawWatchResult(view, 0, watch, is_short=True) vim.eval("vimspector#internal#balloon#ResizeTooltip()")
def Clear( self ): self._current_frame = None self._current_thread = None self._current_syntax = "" self._threads.clear() self._sources = {} self._requesting_threads = StackTraceView.ThreadRequestState.NO self._pending_thread_request = None if self._next_sign_id: signs.UnplaceSign( self._next_sign_id, 'VimspectorStackTrace' ) self._next_sign_id = 0 with utils.ModifiableScratchBuffer( self._buf ): utils.ClearBuffer( self._buf )
def _DrawWatches(self): # FIXME: The drawing is dumb and draws from scratch every time. This is # simple and works and makes sure the line-map is always correct. # However it is pretty inefficient. self._watch.lines.clear() with utils.RestoreCursorPosition(): with utils.ModifiableScratchBuffer(self._watch.buf): utils.ClearBuffer(self._watch.buf) utils.AppendToBuffer(self._watch.buf, 'Watches: ----') for watch in self._watches: line = utils.AppendToBuffer( self._watch.buf, 'Expression: ' + watch.expression['expression']) watch.line = line self._DrawWatchResult(2, watch)
def _DrawWatches( self ): # FIXME: The drawing is dumb and draws from scratch every time. This is # simple and works and makes sure the line-map is always correct. # However it is really inefficient, and makes it so that expanded results # are collapsed on every step. self._watch.lines.clear() with utils.RestoreCursorPosition(): with utils.ModifiableScratchBuffer( self._watch.win.buffer ): utils.ClearBuffer( self._watch.win.buffer ) utils.AppendToBuffer( self._watch.win.buffer, 'Watches: ----' ) for watch in self._watches: line = utils.AppendToBuffer( self._watch.win.buffer, 'Expression: ' + watch[ 'expression' ] ) watch[ '_line' ] = line self._DrawWatchResult( 2, watch )
def _DrawThreads(self): self._line_to_frame.clear() self._line_to_thread.clear() with utils.ModifiableScratchBuffer(self._buf): utils.ClearBuffer(self._buf) for thread in self._threads: icon = '+' if '_frames' not in thread else '-' line = utils.AppendToBuffer( self._buf, '{0} Thread: {1}'.format(icon, thread['name'])) self._line_to_thread[line] = thread self._DrawStackTrace(thread)
def Clear(self): with utils.ModifiableScratchBuffer(self._vars.win.buffer): utils.ClearBuffer(self._vars.win.buffer) with utils.ModifiableScratchBuffer(self._watch.win.buffer): utils.ClearBuffer(self._watch.win.buffer) self._current_syntax = ''