@@ -50,20 +50,20 @@ local function external_command_args(cur_lines)
5050end
5151
5252autoclip_method .register_handler (' clipboard' , function (current_subtitle_lines )
53- self .copy_to_clipboard (" autocopy action" , current_subtitle_lines .primary )
53+ self .copy_to_clipboard (" autocopy action" , current_subtitle_lines .raw . primary )
5454end )
5555
5656autoclip_method .register_handler (' goldendict' , function (current_subtitle_lines )
5757 h .subprocess_detached {
58- args = { ' goldendict' , current_subtitle_lines .primary },
58+ args = {' goldendict' , current_subtitle_lines .get_prepared (). primary },
5959 completion_fn = on_external_finish
6060 }
6161end )
6262
6363autoclip_method .register_handler (' custom_command' , function (current_subtitle_lines )
6464 if not h .is_empty (self .config .autoclip_custom_args ) then
6565 h .subprocess {
66- args = external_command_args (current_subtitle_lines ),
66+ args = external_command_args (current_subtitle_lines . get_prepared () ),
6767 completion_fn = on_external_finish
6868 }
6969 end
@@ -86,7 +86,18 @@ local function current_subtitle_lines()
8686 secondary = mp .get_property (" secondary-sub-text" ) or " "
8787 end
8888
89- return { primary = self .clipboard_prepare (primary ), secondary = secondary }
89+ return {
90+ get_prepared = function ()
91+ return {
92+ primary = self .clipboard_prepare (primary ),
93+ secondary = secondary
94+ }
95+ end ,
96+ raw = {
97+ primary = primary ,
98+ secondary = secondary
99+ }
100+ }
90101end
91102
92103local function copy_primary_sub ()
0 commit comments