-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix panic #100
fix panic #100
Conversation
v.Screen = append(v.Screen, []ecma48.StyledChar{}) | ||
} | ||
xDiff := v.Cursor.X - len(v.Screen[v.Cursor.Y]) + 1 | ||
if xDiff > 0 { | ||
v.Screen = append(v.Screen, make([]ecma48.StyledChar, xDiff)) | ||
v.Screen[v.Cursor.Y] = append(v.Screen[v.Cursor.Y], make([]ecma48.StyledChar, xDiff)...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do I feel like using append will cause bugs XD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, append is scary. But it's supposed to be safe when appending something to itself unless slice stuff is going on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, though there are some concerns that I have.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
When exiting vim!