File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ Describe 'cfme'
2828 End
2929
3030 Mock fzf
31- echo " header: 1 entry header"
31+ echo " 1 | 1 entry header"
3232 End
3333
3434 Mock mock_editor
Original file line number Diff line number Diff line change @@ -26,9 +26,9 @@ pick_from_headers() {
2626 # Add a final marker to ensure the last message is captured correctly
2727 echo " === END ===" >> " $temp_file "
2828
29- selected_line=$( printf ' %s\n' " ${headers_ref[@]} " | sort -rn | nl -w1 -s' ' | fzf --ansi \
29+ selected_line=$( printf ' %s\n' " ${headers_ref[@]} " | sort -rn | sed ' s/^[0-9]* // ' | nl -w1 -s' | ' | fzf --ansi \
3030 --prompt=" Select commit message: " \
31- --preview " sed -n ' /=== MESSAGE {1} ===/,/=== MESSAGE/p' '$temp_file ' | head -n -1 | tail -n +2" \
31+ --preview " num= \$ (echo {} | grep -o '^[0-9]*'); sed -n \" /=== MESSAGE \$ num ===/,/=== MESSAGE/p\" '$temp_file ' | head -n -1 | tail -n +2" \
3232 --preview-window=wrap)
3333
3434 local exit_code=$?
@@ -39,6 +39,6 @@ pick_from_headers() {
3939 return 1
4040 }
4141
42- # Remove the line number and score prefix
43- echo " ${selected_line#* } " | sed ' s/^[0-9]* //'
42+ # Remove the rank number and separator
43+ echo " ${selected_line} " | sed ' s/^[0-9]* | //'
4444}
You can’t perform that action at this time.
0 commit comments