mirror of
https://github.com/junegunn/fzf.git
synced 2026-02-07 10:21:13 +08:00
* Enhance install script to handle commented and uncommented lines (#3632) Resolves #3632 Enhance install script to handle commented and uncommented lines in shell file with user prompts for modification. - Track commented and uncommented lines in the file. - Prompt user to append or skip if the line is commented. - Ensure new lines are added only when necessary, based on user input. - To the `fish_user_key_bindings.fish`, the original logic would append the line to the end if no corresponding statement was found. I’ve adopted the same behavior for commented lines. * Refactor append_line function to improve line existence check. - Replaced `lno` variable with `lines` to store matching lines and simplified the logic. - Improved line existence check, now prints all matching lines directly and handles commented lines separately. - Removed unnecessary variables like `all_commented`, `commented_lines`, and `non_commented_lines`. * Fix indentation --------- Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
10 KiB
Executable File
10 KiB
Executable File