File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ exec avim -p " $( xsel -bo) "
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ struct {
1212 {'k' , "kill" },
1313 {'l' , "look" },
1414 {'o' , "open" },
15+ {'p' , "plumb" },
1516 {'s' , "scratch" },
1617 {'w' , "cwd" },
1718};
@@ -106,9 +107,11 @@ void request(char *argv[], size_t argc) {
106107 avim_strv req = vec_new ();
107108 vec_push (& req , cmds [mode ].name );
108109 int cmd = cmds [mode ].opt ;
109- if (cmd == 's' ) {
110+ if (cmd == 'p' || cmd == ' s' ) {
110111 vec_push (& req , cwd );
111- vec_push (& req , "" );
112+ if (cmd == 's' ) {
113+ vec_push (& req , "" );
114+ }
112115 }
113116 for (size_t i = 0 ; i < argc ; i ++ ) {
114117 char * arg = argv [i ];
Original file line number Diff line number Diff line change @@ -583,6 +583,9 @@ function AcmeOpen(name, pos)
583583endfunc
584584
585585function s: RgOpen (pos)
586+ if s: plumbclick <= 0
587+ return 0
588+ endif
586589 call win_execute (s: plumbwin ,
587590 \ ' let s:l = search("\\v^(\\s*(\\d+[-:]|\\-\\-$))@!", "bnW")' )
588591 let f = getbufoneline (winbufnr (s: plumbwin ), s: l )
@@ -1131,6 +1134,8 @@ function s:CtrlRecv(ch, data)
11311134 call s: Edit (args , cid, ' diff' )
11321135 call s: Diff (args )
11331136 let resp = []
1137+ elseif cmd == ' plumb' && len (args ) > 1
1138+ call s: Open (args [1 ], 0 , [args [0 ]], 0 )
11341139 endif
11351140 if resp != []
11361141 call s: CtrlSend ([cid] + resp)
You can’t perform that action at this time.
0 commit comments