<commit_before>function cdup --description 'CD up until given folder'
	set pwd (<PASSWORD>);
	set target_folder $argv[1];

	if [ ! (string match -r '/'$target_folder'/' $pwd) ]
		echo Folder $target_folder is not in the pwd: $pwd;
		return;
	end;

	set folder_arr (string split '/' $pwd);
	set folder_count 1;
	for folder in $folder_arr
		if [ $folder != $target_folder ]
			set folder_count (math $folder_count + 1);
		else
			cd (string join '/' $folder_arr[1..$folder_count]);
			return;
		end;
	end;
end;<commit_msg>Fix cdup to search from current dir towards root.<commit_after>function cdup --description 'CD up until given folder'
	set pwd (<PASSWORD>)
	set target_folder $argv[1]

	if [ ! (string match -r '/'$target_folder'/' $pwd) ]
		echo Folder $target_folder is not in the pwd: $pwd
		return
	end

	set folder_arr (string split '/' $pwd)
	
    # Reverse array and skip current folder from search
    set folder_arr $folder_arr[-2..1]
	
	set folder_count 1
	for folder in $folder_arr
		if [ $folder != $target_folder ]
			set folder_count (math $folder_count + 1);
		else
            set folder_arr $folder_arr[$folder_count..-1]
			cd (string join '/' $folder_arr[-1..1]);
			return
		end
	end
end
{'fraction_non_alphanumeric': 0.12231404958677686, 'fraction_numerical': 0.009917355371900827, 'mean_word_length': 3.5186567164179103, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5884132', 'n_tokens_mistral': 455, 'n_tokens_neox': 416, 'n_words': 141}