Unicode replacement char for non-displayable chars
This commit is contained in:
parent
afeb07a024
commit
51ab8f9914
1 changed files with 5 additions and 0 deletions
|
@ -4,6 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"sync"
|
"sync"
|
||||||
|
"unicode"
|
||||||
|
|
||||||
"github.com/zyedidia/micro/v2/internal/config"
|
"github.com/zyedidia/micro/v2/internal/config"
|
||||||
"github.com/zyedidia/micro/v2/internal/util"
|
"github.com/zyedidia/micro/v2/internal/util"
|
||||||
|
@ -97,6 +98,10 @@ func ShowCursor(x, y int) {
|
||||||
// SetContent sets a cell at a point on the screen and makes sure that it is
|
// SetContent sets a cell at a point on the screen and makes sure that it is
|
||||||
// synced with the last cursor location
|
// synced with the last cursor location
|
||||||
func SetContent(x, y int, mainc rune, combc []rune, style tcell.Style) {
|
func SetContent(x, y int, mainc rune, combc []rune, style tcell.Style) {
|
||||||
|
if !unicode.IsPrint(mainc) {
|
||||||
|
mainc = '<27>'
|
||||||
|
}
|
||||||
|
|
||||||
Screen.SetContent(x, y, mainc, combc, style)
|
Screen.SetContent(x, y, mainc, combc, style)
|
||||||
if util.FakeCursor && lastCursor.x == x && lastCursor.y == y {
|
if util.FakeCursor && lastCursor.x == x && lastCursor.y == y {
|
||||||
lastCursor.r = mainc
|
lastCursor.r = mainc
|
||||||
|
|
Loading…
Reference in a new issue