- Timestamp:
- Jul 11, 2009, 1:14:35 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:
- 2fc8397
- Parents:
- 3e36085
- git-author:
- Karl Ramm <kcr@1ts.org> (06/15/09 11:56:08)
- git-committer:
- Nelson Elhage <nelhage@mit.edu> (07/11/09 13:14:35)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
editwin.c
r3e36085 r77f605d 56 56 static int owl_editwin_is_char_in(owl_editwin *e, char *set); 57 57 static gunichar owl_editwin_get_char_at_point(owl_editwin *e); 58 static int owl_editwin_replace(owl_editwin *e, int count, char *s);59 58 static char *oe_copy_buf(owl_editwin *e, char *buf, int len); 60 59 static int oe_copy_region(owl_editwin *e); 61 60 static int oe_display_column(owl_editwin *e); 61 static char *oe_chunk(owl_editwin *e, int start, int end); 62 62 63 63 #define INCR 4096 … … 565 565 566 566 /* replace count characters at the point with s, returning the change in size */ 567 staticint owl_editwin_replace(owl_editwin *e, int replace, char *s)567 int owl_editwin_replace(owl_editwin *e, int replace, char *s) 568 568 { 569 569 int start, end, i, free, need, size, change; … … 1260 1260 } 1261 1261 1262 int owl_editwin_get_echochar(owl_editwin *e) { 1262 int owl_editwin_get_echochar(owl_editwin *e) 1263 { 1263 1264 return e->echochar; 1264 1265 } 1266 1267 static char *oe_chunk(owl_editwin *e, int start, int end) 1268 { 1269 char *p; 1270 1271 p = owl_malloc(end - start + 1); 1272 memcpy(p, e->buff + start, end - start); 1273 p[end - start] = 0; 1274 1275 return p; 1276 } 1277 1278 char *owl_editwin_text_before_point(owl_editwin *e) 1279 { 1280 return oe_chunk(e, e->index < e->lock ? 0 : e->lock, e->index); 1281 } 1282 1283 char *owl_editwin_text_after_point(owl_editwin *e) 1284 { 1285 return oe_chunk(e, e->index, e->bufflen); 1286 } 1287 1265 1288 1266 1289
Note: See TracChangeset
for help on using the changeset viewer.