mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-05 13:07:50 +00:00
Fix #391 - Strip non-printable characters
This commit is contained in:
parent
ae04f56dbd
commit
4d709e0dd2
@ -11,6 +11,7 @@ import "C"
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
@ -514,7 +515,12 @@ func MoveAndClear(y int, x int) {
|
||||
}
|
||||
|
||||
func Print(text string) {
|
||||
C.addstr(C.CString(text))
|
||||
C.addstr(C.CString(strings.Map(func(r rune) rune {
|
||||
if r < 32 {
|
||||
return -1
|
||||
}
|
||||
return r
|
||||
}, text)))
|
||||
}
|
||||
|
||||
func CPrint(pair int, bold bool, text string) {
|
||||
|
Loading…
Reference in New Issue
Block a user