irssi-import / bugs.irssi.org

bugs.irssi.org archive
https://github.com/irssi/irssi/issues
0 stars 0 forks source link

$[num]variable syntax truncates to zero width and worse in nested templates #786

Open irssibot opened 13 years ago

irssibot commented 13 years ago

A working example:

# ...
  join = "$0$1-";
  pad = "|$0|$1-|";
  msgnick = "{pad {join <$0$1->}}%n %|";
  ownmsgnick = "{msgnick $0 $1-}"; 
# ...

The output is, as expected: |<@Geralt>|| and demonstrates that the result of join is a single string, i.e. it concatenates multiple arguments into a single argument.

If we replace pad with pad = "|$[-9]0|$1-|"; we get: ||| instead of the expected output: |<@Geralt>|| If you try other number you get different things, here are some that I tried: pad = "|$[-10]0|$1-|"; gives |<|| pad = "|$[-20]0|$1-|"; gives |<@ownnick|| pad = "|$[-30]0|$1-|"; gives | <@Geralt>|| pad = "|$[10]0|$1-|"; gives |<|| pad = "|$[20]0|$1-|"; gives |<@ownnick|| pad = "|$[30]0|$1-|"; gives |<@Geralt> || pad = "|$[40]0|$1-|"; gives |<@Geralt>...........|| (spaces replaced by dots)