Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: insert-last-word (was Re: zsh request)



On Nov 22,  9:09am,  JD Laub wrote:
} Subject: insert-last-word (was Re: zsh request)
}
} Bart Schaefer writes:
} > not able to distinguish the 1 prefix from no prefix at all).
} 
} Not that I'm objecting to the implementation, but I'm curious: gotmult
} gets set if the user supplied a prefix, with zmult storing the actual
} prefix.  Am I missing something?

No, I am.  It's been so long since I changed any zle functions, I'd
forgotten that it existed; there are only two places outside zle_vi.c
where it's tested, so I didn't spot it when looking at other functions
that use zmult ...

I still think the way I did it is the best way, though.  With gotmult,
it could be changed so that -1 was the last word, -2 the second-last,
etc., as with array subscripting; but since the name of the function
is insert-LAST-word, I think it makes sense to count from the right
without having to type that extra `ESC -'.

-- 
Bart Schaefer                             Brass Lantern Enterprises
http://www.well.com/user/barts            http://www.nbn.com/people/lantern



Messages sorted by: Reverse Date, Date, Thread, Author