Skip to content
Snippets Groups Projects
Commit d1ecbe5d authored by deuce's avatar deuce
Browse files

Fix behaviour when inserting a line due to wrap from a line with a hard CR

Previously, the hard CR was retained, and the wrapped test was added to the
beginning of the next line.  Now the hard CR is cleared from the original
line and set on the newly inserted line.  We also need to redraw lines
after the inserted line now.
parent 73144f04
No related branches found
No related tags found
No related merge requests found
......@@ -328,6 +328,7 @@ function wrap_line(l)
var nline;
var m;
var m2;
var i;
while(1) {
if(line[l]==undefined)
......@@ -353,6 +354,15 @@ function wrap_line(l)
if(m!=null) {
if(line[l+1]==undefined)
line.push(new Line);
else {
if(line[l].hardcr) {
line.splice(l+1,0,new Line);
line[l].hardcr=false;
line[l+1].hardcr=true;
for(i=l+2; i<line.length; i++)
draw_line(i);
}
}
line[l+1].text=m[2]+line[l+1].text;
line[l+1].attr=line[l].attr.substr(m[1].length)+line[l+1].attr;
line[l].text=m[1];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment