fixed trim function
replace len with strdisplaywidth