teco

Check-in [dab2d2a6de]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix corrupt buffer lists after undo/continue
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:dab2d2a6de14f0d0d1ff4dc0ad0f32c0ad58dcf66265b770654c5a42e2c671b6
User & Date: ajv-899-334-8894@vsta.org 2014-01-16 00:35:37
Context
2014-01-16
00:36
Ignore ctags check-in: 6c36f04c05 user: ajv-899-334-8894@vsta.org tags: master, trunk
00:35
Fix corrupt buffer lists after undo/continue check-in: dab2d2a6de user: ajv-899-334-8894@vsta.org tags: master, trunk
2013-12-22
20:02
typo check-in: 9eb673b74e user: ajv-899-334-8894@vsta.org tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to undo.c.

225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
...
250
251
252
253
254
255
256

257
258
259
260
261
262
263
...
332
333
334
335
336
337
338

339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
	if (dot < buff_mod) {
	    buff_mod = dot;
	}

	/* Put chars back into text buffer */
	uc = undo->count;
	if (undo->op == UNDO_DEL) {
	    cc.p = undo->p;
	    cc.c = 0;
	    insert1();
	    movenchars(&cc, &bb, uc);
	    insert2(uc, 0);

	/* Remove chars from text buffer */
	} else if (undo->op == UNDO_INS) {
	    /*
	     * Save this text first time we undo this insertion; this
	     *  is in case we are asked to "redo" the undo.
................................................................................
	    }

	    /* Cribbed from delete1() */
	    set_pointer(dot, &dest);
	    set_pointer(dot + uc, &src);
	    movenchars(&src, &dest, z - (dot + uc));
	    free_blist(dest.p->f);

	    z -= uc;

	/* Shouldn't happen */
	} else {
	    ASSERT(0);
	}

................................................................................
	if (undo->op == UNDO_DEL) {

	    /* Cribbed from delete1() */
	    set_pointer(dot, &dest);
	    set_pointer(dot + uc, &src);
	    movenchars(&src, &dest, z - (dot + uc));
	    free_blist(dest.p->f);

	    z -= uc;

	/* Make the insertion happen again */
	} else if (undo->op == UNDO_INS) {
	    ASSERT(undo->p);
	    cc.p = undo->p;
	    cc.c = 0;
	    insert1();
	    movenchars(&cc, &bb, uc);
	    insert2(uc, 0);

	/* Shouldn't happen */
	} else {
	    ASSERT(0);
	}








|
|

|







 







>







 







>





|
|

|







225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
...
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
...
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
	if (dot < buff_mod) {
	    buff_mod = dot;
	}

	/* Put chars back into text buffer */
	uc = undo->count;
	if (undo->op == UNDO_DEL) {
	    src.p = undo->p;
	    src.c = 0;
	    insert1();
	    movenchars(&src, &bb, uc);
	    insert2(uc, 0);

	/* Remove chars from text buffer */
	} else if (undo->op == UNDO_INS) {
	    /*
	     * Save this text first time we undo this insertion; this
	     *  is in case we are asked to "redo" the undo.
................................................................................
	    }

	    /* Cribbed from delete1() */
	    set_pointer(dot, &dest);
	    set_pointer(dot + uc, &src);
	    movenchars(&src, &dest, z - (dot + uc));
	    free_blist(dest.p->f);
	    dest.p->f = NULL;
	    z -= uc;

	/* Shouldn't happen */
	} else {
	    ASSERT(0);
	}

................................................................................
	if (undo->op == UNDO_DEL) {

	    /* Cribbed from delete1() */
	    set_pointer(dot, &dest);
	    set_pointer(dot + uc, &src);
	    movenchars(&src, &dest, z - (dot + uc));
	    free_blist(dest.p->f);
	    dest.p->f = NULL;
	    z -= uc;

	/* Make the insertion happen again */
	} else if (undo->op == UNDO_INS) {
	    ASSERT(undo->p);
	    src.p = undo->p;
	    src.c = 0;
	    insert1();
	    movenchars(&src, &bb, uc);
	    insert2(uc, 0);

	/* Shouldn't happen */
	} else {
	    ASSERT(0);
	}