From 030e3241ec73ee1aca9612ad0eb58b6c6185cf4c Mon Sep 17 00:00:00 2001 From: critiqjo Date: Tue, 21 Jul 2015 18:53:46 +0530 Subject: [PATCH] Customize disassembly; +LLrefresh --- plugin/lldb.vim | 1 + rplugin/python/lldb_ctrl/__init__.py | 7 ++++++- rplugin/python/lldb_ctrl/controller.py | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/plugin/lldb.vim b/plugin/lldb.vim index dbca263..db66f6a 100644 --- a/plugin/lldb.vim +++ b/plugin/lldb.vim @@ -140,6 +140,7 @@ endfun command! LLredraw call LLTabCheckClose() | call LLUpdateLayout() nnoremap :call LLBreakswitch(bufnr('%'), getcurpos()[1]) +nnoremap :LLrefresh nnoremap :LLredraw nnoremap :LLcontinue nnoremap :LLprint =expand('') diff --git a/rplugin/python/lldb_ctrl/__init__.py b/rplugin/python/lldb_ctrl/__init__.py index 46db3e0..c9a0af5 100644 --- a/rplugin/python/lldb_ctrl/__init__.py +++ b/rplugin/python/lldb_ctrl/__init__.py @@ -126,6 +126,10 @@ def _complete(self, args): def _exit(self, args): self.ctrl.safe_exit() + @neovim.command('LLrefresh') + def _refresh(self): + self.ctrl.safe_call(self.ctrl.update_ui, [False, '!all']) + @neovim.command('LLrun', nargs='*') def _run(self, args): # FIXME: Remove in favor of `LLprocess launch` and `LLstart`? @@ -171,7 +175,8 @@ def _continue(self, args): @neovim.command('LLdisassemble', nargs='*', complete='custom,LLComplete') def _disassemble(self, args): - self.ctrl.safe_execute("disassemble", args) + self.ctrl.safe_call(self.ctrl.do_disassemble, [' '.join(args)]) + self.safe_vim_command('drop disassembly') @neovim.command('LLexpression', nargs='*', complete='custom,LLComplete') def _expression(self, args): diff --git a/rplugin/python/lldb_ctrl/controller.py b/rplugin/python/lldb_ctrl/controller.py index 1d84976..af5c535 100644 --- a/rplugin/python/lldb_ctrl/controller.py +++ b/rplugin/python/lldb_ctrl/controller.py @@ -177,6 +177,10 @@ def do_command(self, args): if args.startswith('so'): # source self.update_ui(buf='breakpoints') + def do_disassemble(self, args): + self.ui._content_map['disassembly'][1][1] = args + self.update_ui(buf='disassembly') + def do_breakswitch(self, bufnr, line): """ Switch breakpoint at the specified line in the buffer. """ key = (bufnr, line)