Changeset a88f35a
- Timestamp:
- Jul 11, 2009, 1:14:36 PM (15 years ago)
- Branches:
- master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- cf26b72
- Parents:
- 0190c4d
- git-author:
- Nelson Elhage <nelhage@mit.edu> (06/20/09 23:45:56)
- git-committer:
- Nelson Elhage <nelhage@mit.edu> (07/11/09 13:14:36)
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
editwin.c
r19a023f ra88f35a 9 9 #define VALID_EXCURSION (0x9a2b4729) 10 10 11 typedef struct oe_excursion_struct{ /*noproto*/11 typedef struct _owl_editwin_excursion { /*noproto*/ 12 12 int valid; 13 13 int index; … … 15 15 int goal_column; 16 16 int lock; 17 struct oe_excursion_struct*next;17 struct _owl_editwin_excursion *next; 18 18 } oe_excursion; 19 19 … … 365 365 oe_release_excursion(e, x); 366 366 } 367 } 368 369 /* External interface to oe_save_excursion */ 370 owl_editwin_excursion *owl_editwin_begin_excursion(owl_editwin *e) 371 { 372 owl_editwin_excursion *x = owl_malloc(sizeof *x); 373 oe_save_excursion(e, x); 374 return x; 375 } 376 377 void owl_editwin_end_excursion(owl_editwin *e, owl_editwin_excursion *x) 378 { 379 oe_restore_excursion(e, x); 380 owl_free(x); 367 381 } 368 382 … … 565 579 } 566 580 581 int owl_editwin_replace_region(owl_editwin *e, char *s) 582 { 583 oe_excursion x; 584 oe_save_excursion(e, &x); 585 int ret; 586 587 if(e->index > e->mark) { 588 owl_editwin_exchange_point_and_mark(e); 589 } 590 591 ret = owl_editwin_replace_internal(e, e->mark - e->index, s); 592 593 oe_restore_excursion(e, &x); 594 595 return ret; 596 } 597 567 598 /* replace 'replace' characters at the point with s, returning the change in size */ 568 599 int owl_editwin_replace(owl_editwin *e, int replace, char *s) -
owl.h
ra556caa ra88f35a 425 425 426 426 typedef struct _owl_editwin owl_editwin; 427 typedef struct _owl_editwin_excursion owl_editwin_excursion; 427 428 428 429 typedef struct _owl_keybinding { -
perlglue.xs
r0190c4d ra88f35a 474 474 OUTPUT: 475 475 RETVAL 476 477 int 478 replace_region(string) 479 char *string; 480 CODE: 481 RETVAL = owl_editwin_replace_region(owl_global_get_typwin(&g), string); 482 OUTPUT: 483 RETVAL 484 485 SV * 486 save_excursion(sub) 487 SV *sub; 488 PROTOTYPE: & 489 PREINIT: 490 int count; 491 owl_editwin_excursion *x; 492 CODE: 493 { 494 x = owl_editwin_begin_excursion(owl_global_get_typwin(&g)); 495 count = call_sv(sub, G_SCALAR|G_EVAL|G_NOARGS); 496 owl_editwin_end_excursion(owl_global_get_typwin(&g), x); 497 498 if(SvTRUE(ERRSV)) { 499 croak(NULL); 500 } 501 502 SPAGAIN; 503 if(count == 1) 504 RETVAL = SvREFCNT_inc(POPs); 505 else 506 XSRETURN_UNDEF; 507 508 } 509 OUTPUT: 510 RETVAL
Note: See TracChangeset
for help on using the changeset viewer.