Browse CVS Repository
Diff of /shiki/shiki/xyzzylisp.c
Parent Directory
| Revision Log
| Revision Graph
| Patch
| 20 |
if (!SCM_EXACTP(end_scm)) Scm_Error("C integer required, but got %S", end_scm); |
if (!SCM_EXACTP(end_scm)) Scm_Error("C integer required, but got %S", end_scm); |
| 21 |
end = Scm_GetInteger(end_scm); |
end = Scm_GetInteger(end_scm); |
| 22 |
{ |
{ |
| 23 |
ScmObj start, end, result; |
{ |
| 24 |
GtkTextIter s, e; |
ScmString* SCM_RESULT; |
| 25 |
gchar *substring; |
gchar *substr = Shiki_buffer_substring(start, end); |
| 26 |
if(Scm_NumCmp(start, end) >= 0) |
if(substr) |
| 27 |
return SCM_FALSE; |
SCM_RESULT = SCM_STRING(SCM_MAKE_STR_COPYING(substr)); |
| 28 |
gtk_text_buffer_get_iter_at_offset(Shiki_CURRENT_TEXT_BUFFER, &s, SCM_INT_VALUE(start)); |
else |
| 29 |
gtk_text_buffer_get_iter_at_offset(Shiki_CURRENT_TEXT_BUFFER, &e, SCM_INT_VALUE(end)); |
SCM_RESULT = SCM_STRING(SCM_FALSE); |
| 30 |
|
g_free(substr); |
| 31 |
substring = gtk_text_buffer_get_text(Shiki_CURRENT_TEXT_BUFFER, &s, &e, FALSE); |
SCM_RETURN(SCM_MAKE_MAYBE(SCM_OBJ_SAFE, SCM_RESULT)); |
| 32 |
result = SCM_MAKE_STR_COPYING(substring); |
} |
|
g_free(substring); |
|
|
SCM_RETURN(result); |
|
| 33 |
} |
} |
| 34 |
} |
} |
| 35 |
|
|
|
|
Legend:
| Removed from v.1.2 |
|
| changed lines |
| |
Added in v.1.3 |
|
|
| |