A start with a line, say

This line is really too long.

 

A length, say 25, and suffix, say '...'.  I would like to be able to do something like this

 

[% my_truncate(line, 25, '...') %]

 

And end up with

 

This line is really t...

 

Just wondering if there is something out there that already does this.  I saw the Wrap and Autoformat stuff and didn't look too close, but it didn't look promising.  I am happy to contribute a plugin, but don't want to duplicate the work.  And yes, I know it is a dumb thing, that I will write in like five minutes.

 

Thanks,

Earl

Reply via email to