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