-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
bugSomething that's not working as intendedSomething that's not working as intended
Milestone
Description
I added a function via the interactive commandline as follows:
mqudsi@Blitzkrieg /m/d/r/fish> function replace_in
# argv[1] is the regex pattern of files to match, fed to `fd`
# argv[2] is the pattern of text to search for
# argv[3] is the pattern of text it should be replaced with
for f in (fd $argv[1] .)
string replace -a -- $argv[2] $argv[3] < $f | rewrite $f
end
endBut saving this function is parsed/saved with the commented first line replaced with a blank line (the line is lost entirely):
mqudsi@Blitzkrieg /m/d/r/fish> type replace_in
replace_in is a function with definition
function replace_in
# argv[2] is the pattern of text to search for
# argv[3] is the pattern of text it should be replaced with
for f in (fd $argv[1] .)
string replace -a -- $argv[2] $argv[3] <$f | rewrite $f
end
end(Same result after funcsave or funced)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething that's not working as intendedSomething that's not working as intended