Update zrep functions to use function keyword for consistency.

- Updated `zrep_load_theme` to use `function` keyword.
- Updated `zrep_search_url_encode` to use `function` keyword.
- Updated `zrep_search` to use `function` keyword.
This commit is contained in:
Stig-Ørjan Smelror 2024-04-07 01:28:51 +02:00
parent 2ccef547a8
commit 933b27b167

6
zpi
View File

@ -84,7 +84,7 @@ typeset -A base_colors=(
# Define the global associative array to hold the current theme # Define the global associative array to hold the current theme
declare -A current_theme declare -A current_theme
zrep_load_theme() { function zrep_load_theme() {
local theme_name="$1" local theme_name="$1"
local theme_file="${config[main_zrep_install_dir]}/themes/${theme_name}" local theme_file="${config[main_zrep_install_dir]}/themes/${theme_name}"
@ -137,7 +137,7 @@ function zrep_msg() {
################################################################################################# #################################################################################################
# Function to URL-encode strings in Zsh # Function to URL-encode strings in Zsh
zrep_search_url_encode() { function zrep_search_url_encode() {
local string="${1}" local string="${1}"
local strlen=${#string} local strlen=${#string}
local encoded="" local encoded=""
@ -156,7 +156,7 @@ zrep_search_url_encode() {
} }
# Function to perform a search query and process JSON response # Function to perform a search query and process JSON response
zrep_search() { function zrep_search() {
local searchTerm="${@}" local searchTerm="${@}"
local encodedSearch=$(zrep_search_url_encode "${searchTerm}") local encodedSearch=$(zrep_search_url_encode "${searchTerm}")