diff --git a/autoload/jukit/splits.vim b/autoload/jukit/splits.vim index b1c3a9d..8f4a87b 100644 --- a/autoload/jukit/splits.vim +++ b/autoload/jukit/splits.vim @@ -215,14 +215,14 @@ fun! jukit#splits#_build_shell_cmd(...) abort \. 'matplotlib.use("module://matplotlib-backend-kitty");' \. 'plt.show.__annotations__["save_dpi"] = ' . g:jukit_savefig_dpi . ";" elseif g:jukit_terminal == 'tmux' - let current_pane = matchstr(system('tmux run "echo #{pane_id}"'), '%\d*') + let current_pane = $TMUX_PANE if is_outhist let target_pane = g:jukit_outhist_title else let target_pane = g:jukit_output_title endif let cmd = cmd - \. 'matplotlib.use("module://imgcat");' + \. 'matplotlib.use("module://imgcat_jukit");' \. 'plt.show.__annotations__["tmux_panes"] = ["' \. current_pane . '", "' . target_pane . '"];' \. 'plt.show.__annotations__["save_dpi"] = ' . g:jukit_savefig_dpi . ";" diff --git a/autoload/jukit/tmux/layouts.vim b/autoload/jukit/tmux/layouts.vim index a7d115b..85a89d1 100644 --- a/autoload/jukit/tmux/layouts.vim +++ b/autoload/jukit/tmux/layouts.vim @@ -1,6 +1,7 @@ fun! s:get_pane_by_name(name, output_exists, outhist_exists) abort if a:name == 'file_content' - let current_pane = matchstr(system('tmux run "echo #{pane_id}"'), '%\d*') + " let current_pane = matchstr(system('tmux run "echo #{pane_id}"'), '%\d*') + let current_pane = $TMUX_PANE return current_pane elseif a:name == 'output' && a:output_exists return g:jukit_output_title diff --git a/helpers/imgcat/LICENSE.txt b/helpers/imgcat_jukit/LICENSE.txt similarity index 100% rename from helpers/imgcat/LICENSE.txt rename to helpers/imgcat_jukit/LICENSE.txt diff --git a/helpers/imgcat/__init__.py b/helpers/imgcat_jukit/__init__.py similarity index 94% rename from helpers/imgcat/__init__.py rename to helpers/imgcat_jukit/__init__.py index 6d1cac5..c61cbac 100644 --- a/helpers/imgcat/__init__.py +++ b/helpers/imgcat_jukit/__init__.py @@ -1,7 +1,7 @@ import codecs, io, sys from matplotlib._pylab_helpers import Gcf from matplotlib.figure import Figure -from matplotlib.backend_bases import FigureManagerBase +from matplotlib.backend_bases import FigureManagerBase, FigureCanvasBase import matplotlib.pyplot as plt from .imgcat import imgcat @@ -39,6 +39,8 @@ def show(self): else: imgcat(self.canvas.figure) +class FigureCanvas(FigureCanvasBase): + pass def show(block=None): for manager in Gcf.get_all_fig_managers(): diff --git a/helpers/imgcat/imgcat.py b/helpers/imgcat_jukit/imgcat.py similarity index 100% rename from helpers/imgcat/imgcat.py rename to helpers/imgcat_jukit/imgcat.py