all repos — honk @ e568df22d89c394d44d12879190e2d9e6ebea2b6

my fork of honk

allow renames at end of noise
Ted Unangst tedu@tedunangst.com
Thu, 10 Oct 2019 18:51:09 -0400
commit

e568df22d89c394d44d12879190e2d9e6ebea2b6

parent

6b431fc97646d752ba244f696a12d68c8f2c9726

1 files changed, 4 insertions(+), 3 deletions(-)

jump to
M fun.gofun.go

@@ -326,14 +326,13 @@ }

honk.Noise = re_memes.ReplaceAllStringFunc(honk.Noise, repl) } -var re_quickmention = regexp.MustCompile("(^| )@[[:alnum:]]+ ") +var re_quickmention = regexp.MustCompile("(^| )@[[:alnum:]]+( |$)") func quickrename(s string, userid int64) string { nonstop := true for nonstop { nonstop = false s = re_quickmention.ReplaceAllStringFunc(s, func(m string) string { - log.Printf("m: %s", m) prefix := "" if m[0] == ' ' { prefix = " "

@@ -341,7 +340,9 @@ m = m[1:]

} prefix += "@" m = m[1:] - m = m[:len(m)-1] + if m[len(m)-1] == ' ' { + m = m[:len(m)-1] + } row := stmtOneHonker.QueryRow(m, userid) var xid string