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