@@ -12,6 +12,7 @@ const USER_COMMAND_REFS_MARKER: &str = "{{refs}}";
1212const USER_COMMAND_BRANCHES_MARKER : & str = "{{branches}}" ;
1313const USER_COMMAND_REMOTE_BRANCHES_MARKER : & str = "{{remote_branches}}" ;
1414const USER_COMMAND_TAGS_MARKER : & str = "{{tags}}" ;
15+ const USER_COMMAND_STASH_MARKER : & str = "{{stash}}" ;
1516const USER_COMMAND_AREA_WIDTH_MARKER : & str = "{{area_width}}" ;
1617const USER_COMMAND_AREA_HEIGHT_MARKER : & str = "{{area_height}}" ;
1718
@@ -78,6 +79,7 @@ pub struct ExternalCommandParameters<'a> {
7879 pub branches : Vec < & ' a str > ,
7980 pub remote_branches : Vec < & ' a str > ,
8081 pub tags : Vec < & ' a str > ,
82+ pub stash : Option < & ' a str > ,
8183 pub area_width : u16 ,
8284 pub area_height : u16 ,
8385}
@@ -152,6 +154,7 @@ fn replace_command_arg(s: &str, params: &ExternalCommandParameters) -> String {
152154 let branches = & params. branches . join ( sep) ;
153155 let remote_branches = & params. remote_branches . join ( sep) ;
154156 let tags = & params. tags . join ( sep) ;
157+ let stash = params. stash . unwrap_or_default ( ) ;
155158 let area_width = & params. area_width . to_string ( ) ;
156159 let area_height = & params. area_height . to_string ( ) ;
157160
@@ -162,6 +165,7 @@ fn replace_command_arg(s: &str, params: &ExternalCommandParameters) -> String {
162165 . replace ( USER_COMMAND_BRANCHES_MARKER , branches)
163166 . replace ( USER_COMMAND_REMOTE_BRANCHES_MARKER , remote_branches)
164167 . replace ( USER_COMMAND_TAGS_MARKER , tags)
168+ . replace ( USER_COMMAND_STASH_MARKER , stash)
165169 . replace ( USER_COMMAND_AREA_WIDTH_MARKER , area_width)
166170 . replace ( USER_COMMAND_AREA_HEIGHT_MARKER , area_height)
167171}
0 commit comments