mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-30 14:47:16 +09:00
@@ -78,12 +78,19 @@ func NewLineArray(reader io.Reader) *LineArray {
|
|||||||
|
|
||||||
br := bufio.NewReader(&buf)
|
br := bufio.NewReader(&buf)
|
||||||
|
|
||||||
for i := 0; i < numlines; i++ {
|
i := 0
|
||||||
|
for {
|
||||||
data, err := br.ReadBytes('\n')
|
data, err := br.ReadBytes('\n')
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == io.EOF {
|
if err == io.EOF {
|
||||||
// la.lines[i] = Line{data[:len(data)], nil, nil, false}
|
// la.lines[i] = Line{data[:len(data)], nil, nil, false}
|
||||||
la.lines[i].data = data
|
if i >= len(la.lines) {
|
||||||
|
if len(data) != 0 {
|
||||||
|
la.lines = append(la.lines, Line{data, nil, nil, false})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
la.lines[i].data = data
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Last line was read
|
// Last line was read
|
||||||
break
|
break
|
||||||
@@ -91,6 +98,9 @@ func NewLineArray(reader io.Reader) *LineArray {
|
|||||||
la.lines[i].data = data[:len(data)-1]
|
la.lines[i].data = data[:len(data)-1]
|
||||||
// la.lines[i] = Line{data[:len(data)-1], nil, nil, false}
|
// la.lines[i] = Line{data[:len(data)-1], nil, nil, false}
|
||||||
}
|
}
|
||||||
|
i++
|
||||||
|
}
|
||||||
|
for i := 0; i < numlines; i++ {
|
||||||
}
|
}
|
||||||
|
|
||||||
return la
|
return la
|
||||||
|
|||||||
@@ -201,7 +201,14 @@ func InitScreen() {
|
|||||||
// RedrawAll redraws everything -- all the views and the messenger
|
// RedrawAll redraws everything -- all the views and the messenger
|
||||||
func RedrawAll() {
|
func RedrawAll() {
|
||||||
messenger.Clear()
|
messenger.Clear()
|
||||||
screen.Clear()
|
|
||||||
|
w, h := screen.Size()
|
||||||
|
for x := 0; x < w; x++ {
|
||||||
|
for y := 0; y < h; y++ {
|
||||||
|
screen.SetContent(x, y, ' ', nil, defStyle)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for _, v := range tabs[curTab].views {
|
for _, v := range tabs[curTab].views {
|
||||||
v.Display()
|
v.Display()
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,6 @@
|
|||||||
color-link comment "bold brightgreen"
|
color-link comment "bold brightgreen"
|
||||||
color-link constant "cyan"
|
color-link constant "cyan"
|
||||||
|
color-link constant.specialChar "red"
|
||||||
color-link identifier "blue"
|
color-link identifier "blue"
|
||||||
color-link statement "green"
|
color-link statement "green"
|
||||||
color-link symbol "green"
|
color-link symbol "green"
|
||||||
|
|||||||
Reference in New Issue
Block a user