Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cupric
Fzf
Commits
06a6ad8b
Unverified
Commit
06a6ad8b
authored
8 years ago
by
Junegunn Choi
Browse files
Options
Download
Email Patches
Plain Diff
Update ANSI processor to ignore ^N and ^O
This reverts commit
02c6ad0e
.
parent
02c6ad0e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ansi.go
+2
-2
src/ansi.go
src/curses/curses.go
+1
-7
src/curses/curses.go
with
3 additions
and
9 deletions
+3
-9
src/ansi.go
+
2
-
2
View file @
06a6ad8b
...
...
@@ -35,7 +35,7 @@ func (s *ansiState) equals(t *ansiState) bool {
var
ansiRegex
*
regexp
.
Regexp
func
init
()
{
ansiRegex
=
regexp
.
MustCompile
(
"
\x1b
.
[0-9;]*."
)
ansiRegex
=
regexp
.
MustCompile
(
"
\x1b
\\
[
[0-9;]*.
|[
\x0e\x0f
]
"
)
}
func
extractColor
(
str
string
,
state
*
ansiState
,
proc
func
(
string
,
*
ansiState
)
bool
)
(
string
,
*
[]
ansiOffset
,
*
ansiState
)
{
...
...
@@ -100,7 +100,7 @@ func interpretCode(ansiCode string, prevState *ansiState) *ansiState {
}
else
{
state
=
&
ansiState
{
prevState
.
fg
,
prevState
.
bg
,
prevState
.
attr
}
}
if
ansiCode
[
1
]
!=
'
[
'
||
ansiCode
[
len
(
ansiCode
)
-
1
]
!=
'm'
{
if
ansiCode
[
0
]
!=
'
\x1b
'
||
ansiCode
[
len
(
ansiCode
)
-
1
]
!=
'm'
{
return
state
}
...
...
This diff is collapsed.
Click to expand it.
src/curses/curses.go
+
1
-
7
View file @
06a6ad8b
...
...
@@ -682,13 +682,7 @@ func (w *Window) Erase() {
}
func
(
w
*
Window
)
Fill
(
str
string
)
bool
{
return
C
.
waddstr
(
w
.
win
,
C
.
CString
(
strings
.
Map
(
func
(
r
rune
)
rune
{
// Remove ^N and ^O (set and unset altcharset)
if
r
==
14
||
r
==
15
{
return
-
1
}
return
r
},
str
)))
==
C
.
OK
return
C
.
waddstr
(
w
.
win
,
C
.
CString
(
str
))
==
C
.
OK
}
func
(
w
*
Window
)
CFill
(
str
string
,
fg
int
,
bg
int
,
a
Attr
)
bool
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets