"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/fe-text/gui-entry.c" between
irssi-1.2.2.tar.gz and irssi-1.2.3.tar.gz

About: irssi is a terminal based IRC client that also supports SILC and ICB protocols via plugins.

gui-entry.c  (irssi-1.2.2):gui-entry.c  (irssi-1.2.3)
skipping to change at line 657 skipping to change at line 657
gui_entry_draw(entry); gui_entry_draw(entry);
} }
void gui_entry_insert_char(GUI_ENTRY_REC *entry, unichar chr) void gui_entry_insert_char(GUI_ENTRY_REC *entry, unichar chr)
{ {
g_return_if_fail(entry != NULL); g_return_if_fail(entry != NULL);
if (chr == 0 || chr == 13 || chr == 10) if (chr == 0 || chr == 13 || chr == 10)
return; /* never insert NUL, CR or LF characters */ return; /* never insert NUL, CR or LF characters */
if (entry->utf8 && entry->pos == 0 && i_wcwidth(chr) == 0) if (entry->utf8 && entry->pos == 0 && unichar_isprint(chr) && i_wcwidth(c hr) == 0)
return; return;
gui_entry_redraw_from(entry, entry->pos); gui_entry_redraw_from(entry, entry->pos);
entry_text_grow(entry, 1); entry_text_grow(entry, 1);
/* make space for the string */ /* make space for the string */
g_memmove(entry->text + entry->pos + 1, entry->text + entry->pos, g_memmove(entry->text + entry->pos + 1, entry->text + entry->pos,
(entry->text_len-entry->pos + 1) * sizeof(unichar)); (entry->text_len-entry->pos + 1) * sizeof(unichar));
skipping to change at line 838 skipping to change at line 838
memcpy(tmp->cutbuffer, entry->text + entry->pos - size, size * sizeof(unichar)); memcpy(tmp->cutbuffer, entry->text + entry->pos - size, size * sizeof(unichar));
break; break;
case CUTBUFFER_UPDATE_NOOP: case CUTBUFFER_UPDATE_NOOP:
/* cannot happen, handled in "if" */ /* cannot happen, handled in "if" */
break; break;
} }
} }
if (entry->utf8) if (entry->utf8)
while (entry->pos-size-w > 0 && while (entry->pos > size + w && i_wcwidth(entry->text[entry->pos
i_wcwidth(entry->text[entry->pos-size-w]) == 0) w++; - size - w]) == 0)
w++;
g_memmove(entry->text + entry->pos - size, entry->text + entry->pos, g_memmove(entry->text + entry->pos - size, entry->text + entry->pos,
(entry->text_len-entry->pos+1) * sizeof(unichar)); (entry->text_len-entry->pos+1) * sizeof(unichar));
if (entry->uses_extents) { if (entry->uses_extents) {
for (i = entry->pos - size; i < entry->pos; i++) { for (i = entry->pos - size; i < entry->pos; i++) {
if (entry->extents[i+1] != NULL) { if (entry->extents[i+1] != NULL) {
g_free(entry->extents[i+1]); g_free(entry->extents[i+1]);
} }
} }
 End of changes. 2 change blocks. 
3 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)