<commit_before>#
# Layout Helpers
#
# These functions are available exclusively within layout files, and enable
# the layout files to function at all, but also provide useful short-hands to
# otherwise more complex means.
#

# Alias tmux to tmuxifier-tmux wrapper.
tmux() {
  tmuxifier-tmux "$@"
}

# Create a new window.
#
# Arguments:
#   - $1: (optional) Name/title of window.
#   - $2: (optional) Shell command to execute when window is created.
#
new_window() {
  if [ -n "$1" ]; then window="$1"; fi
  if [ -n "$2" ]; then local command=("$2"); fi
  if [ -n "$window" ]; then local winarg=(-n "$window"); fi

  tmuxifier-tmux new-window -t "$session:" "${winarg[@]}" "${command[@]}"
  __go_to_window_or_session_path
}

# Split current window/pane vertically.
#
# Arguments:
#   - $1: (optional) Percentage of frame the new pane will use.
#   - $2: (optional) Target pane ID to split in current window.
#
split_v() {
  if [ -n "$1" ]; then local percentage=(-p "$1"); fi
  tmuxifier-tmux split-window -t "$session:$window.$2" -v "${percentage[@]}"<commit_msg>new_window: only set $window and pass `-n` if a name is provided<commit_after>#
# Layout Helpers
#
# These functions are available exclusively within layout files, and enable
# the layout files to function at all, but also provide useful short-hands to
# otherwise more complex means.
#

# Alias tmux to tmuxifier-tmux wrapper.
tmux() {
  tmuxifier-tmux "$@"
}

# Create a new window.
#
# Arguments:
#   - $1: (optional) Name/title of window.
#   - $2: (optional) Shell command to execute when window is created.
#
new_window() {
  if [ -n "$1" ]; then
    window="$1"
    local winarg=(-n "$window")
  fi
  if [ -n "$2" ]; then local command=("$2"); fi

  tmuxifier-tmux new-window -t "$session:" "${winarg[@]}" "${command[@]}"
  __go_to_window_or_session_path
}

# Split current window/pane vertically.
#
# Arguments:
#   - $1: (optional) Percentage of frame the new pane will use.
#   - $2: (optional) Target pane ID to split in current window.
#
split_v() {
  if [ -n "$1" ]; then local percentage=(-p "$1"); fi
  tmuxifier-tmux split-window -t "$session:$window.$2" -v "${percentage[@]}"
{'fraction_non_alphanumeric': 0.15862708719851576, 'fraction_numerical': 0.01020408163265306, 'mean_word_length': 3.7406593406593407, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4514586', 'n_tokens_mistral': 749, 'n_tokens_neox': 728, 'n_words': 257}