Skip to content

Commit

Permalink
feat: import functionality from laktak#118
Browse files Browse the repository at this point in the history
  • Loading branch information
marcdeop committed May 9, 2024
1 parent ef41f12 commit e77dd17
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion extrakto_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def has_single_pane(self):

def get_next_mode(self, next):
if next == "initial":
return self.modes_list[0]
return os.environ.get("extrakto_inital_mode", self.modes_list[0])
else:
return self.next_mode[next]

Expand Down
7 changes: 6 additions & 1 deletion scripts/open.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ if [ "$split_direction" = "a" ]; then
fi
fi

extrakto_inital_mode="$2"
if [ "$split_direction" = "p" ]; then
popup_size=$(get_option "@extrakto_popup_size" "90%")
popup_width=$(echo $popup_size | cut -d',' -f1)
Expand All @@ -35,11 +36,15 @@ if [ "$split_direction" = "p" ]; then
-h "${popup_height:-${popup_width}}" \
-x "${popup_x}" \
-y "${popup_y:-$popup_x}" \
-e extrakto_inital_mode="${extrakto_inital_mode}" \
-E "${extrakto} ${pane_id} popup"
rc=$?
done
exit $rc
else
split_size=$(get_option "@extrakto_split_size" 7)
tmux split-window -${split_direction} -l ${split_size} "tmux setw remain-on-exit off; ${extrakto} ${pane_id} split"
tmux split-window \
-${split_direction} \
-e extrakto_inital_mode="${extrakto_inital_mode}" \
-l ${split_size} "tmux setw remain-on-exit off; ${extrakto} ${pane_id} split"
fi

0 comments on commit e77dd17

Please sign in to comment.