Changeset d41294a
- Timestamp:
- Jul 11, 2009, 1:14:36 PM (16 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:
- c6ecf5c
- Parents:
- cf26b72
- git-author:
- Nelson Elhage <nelhage@mit.edu> (06/21/09 01:08:14)
- git-committer:
- Nelson Elhage <nelhage@mit.edu> (07/11/09 13:14:36)
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
editwin.c
ra88f35a rd41294a 59 59 static char *oe_copy_buf(owl_editwin *e, char *buf, int len); 60 60 static int oe_copy_region(owl_editwin *e); 61 static int oe_display_column(owl_editwin *e);62 61 static char *oe_chunk(owl_editwin *e, int start, int end); 63 62 … … 1113 1112 } 1114 1113 1115 static int oe_display_column(owl_editwin *e)1114 int owl_editwin_current_column(owl_editwin *e) 1116 1115 { 1117 1116 oe_excursion x; … … 1184 1183 while(e->index < e->mark) { 1185 1184 /* if we've travelled too far, linewrap */ 1186 if (o e_display_column(e) >= e->fillcol)1185 if (owl_editwin_current_column(e) >= e->fillcol) 1187 1186 _owl_editwin_linewrap_word(e); 1188 1187 owl_editwin_point_move(e, 1); … … 1323 1322 } 1324 1323 1324 char *owl_editwin_get_region(owl_editwin *e) 1325 { 1326 int start, end; 1327 start = e->index; 1328 end = e->mark; 1329 if(start > end) { 1330 int tmp = end; 1331 end = start; 1332 start = tmp; 1333 } 1334 1335 return oe_chunk(e, start, end); 1336 } 1337 1325 1338 int owl_editwin_get_echochar(owl_editwin *e) 1326 1339 { … … 1347 1360 { 1348 1361 return oe_chunk(e, e->index, e->bufflen); 1362 } 1363 1364 /* 1365 * The only guarantee made about these values is that comparisons 1366 * between them, as well as comparison between multiple calls to these 1367 * functions without modifying the editwin in-between, are meaningful. 1368 */ 1369 1370 int owl_editwin_get_point(owl_editwin *e) 1371 { 1372 return e->index; 1373 } 1374 1375 int owl_editwin_get_mark(owl_editwin *e) 1376 { 1377 return e->mark; 1349 1378 } 1350 1379 -
perl/lib/BarnOwl/Editwin.pm
rcf26b72 rd41294a 18 18 19 19 our @EXPORT_OK = qw(text_before_point text_after_point replace 20 point_move replace_region save_excursion); 20 point_move replace_region get_region 21 save_excursion current_column point mark); 21 22 22 23 1; -
perlglue.xs
ra88f35a rd41294a 483 483 RETVAL 484 484 485 char * 486 get_region() 487 PREINIT: 488 char *region; 489 CODE: 490 region = owl_editwin_get_region(owl_global_get_typwin(&g)); 491 RETVAL = region; 492 OUTPUT: 493 RETVAL 494 CLEANUP: 495 owl_free(region); 496 485 497 SV * 486 498 save_excursion(sub) … … 509 521 OUTPUT: 510 522 RETVAL 523 524 int 525 current_column() 526 CODE: 527 RETVAL = owl_editwin_current_column(owl_global_get_typwin(&g)); 528 OUTPUT: 529 RETVAL 530 531 int 532 point() 533 CODE: 534 RETVAL = owl_editwin_get_point(owl_global_get_typwin(&g)); 535 OUTPUT: 536 RETVAL 537 538 int 539 mark() 540 CODE: 541 RETVAL = owl_editwin_get_mark(owl_global_get_typwin(&g)); 542 OUTPUT: 543 RETVAL
Note: See TracChangeset
for help on using the changeset viewer.