functions or type command will show the wrong line number of an one-line function's definition #5685
Labels
bug
Something that's not working as intended
Milestone
fish, version 3.0.1
I tried to replace all my aliases with abbrs, but since I used some aliases inside other functions defined in my config.fish, and abbrs cannot be used in this kind of situations, I have to use functions here.
And alias is short, such as add a default option for a command, for example
old alias:
new function:
I'll use
find
command in other functions, and I hope these functions could usefind
with-L
option, I don't have to add-L
every time when I use it.type find
command orfunctions find
will show its definition along with file and line number where it is defined.So, the problem is, when I redefined a short alias to one line function like I the
find
function I posted, the line number of the result will be wrong. The real line number in config.fish in $NUM, but the line number intype
orfunctions
is $NUM-1, since I defined another function which will extract this number out, and use it, so this is a problem to me.If the function is defined into multiple line like this:
The line number in
type
orfunctions
is correct.Is this a bug?
The text was updated successfully, but these errors were encountered: