--- rxvt-unicode/src/screen.C 2010/07/01 20:02:43 1.342 +++ rxvt-unicode/src/screen.C 2010/10/14 23:12:11 1.349 @@ -30,9 +30,10 @@ #include -#include "salloc.C" // HACK, should be a seperate compile! +#include "salloc.C" // HACK, should be a separate compile! -static inline void fill_text (text_t *start, text_t value, int len) +static inline void +fill_text (text_t *start, text_t value, int len) { while (len--) *start++ = value; @@ -912,10 +913,15 @@ // if the character doesn't fit into the remaining columns... if (expect_false (screen.cur.col > ncol - width && ncol >= width)) { - // ... artificially enlargen the previous one - c = NOCHAR; - // and try the same character next loop iteration - --str; + if (screen.flags & Screen_Autowrap) + { + // ... artificially enlargen the previous one + c = NOCHAR; + // and try the same character next loop iteration + --str; + } + else + screen.cur.col = ncol - width; } line->touch (); @@ -1022,6 +1028,10 @@ #endif } } +#ifdef TERMCAP_HAS_BW + else if (screen.flags & Screen_WrapNext) + screen.flags &= ~Screen_WrapNext; +#endif else scr_gotorc (0, -1, RELATIVE); } @@ -1337,16 +1347,13 @@ min_it (num, nrow - row); - // TODO: the code below does not work when view_start != 0 - // the workaround is to disable the clear and use a normal refresh - // when view_start != 0. mysterious. if (rstyle & (RS_Blink | RS_RVid | RS_Uline)) ren = (rend_t) ~RS_None; else if (GET_BASEBG (rstyle) == Color_bg) { ren = DEFAULT_RSTYLE; - if (mapped && !view_start) + if (mapped) XClearArea (dpy, vt, 0, Row2Pixel (row - view_start), (unsigned int)width, (unsigned int)Height2Pixel (num), False); @@ -1355,7 +1362,7 @@ { ren = rstyle & (RS_fgMask | RS_bgMask); - if (mapped && !view_start) + if (mapped) { gcvalue.foreground = pix_colors[bgcolor_of (rstyle)]; XChangeGC (dpy, gc, GCForeground, &gcvalue); @@ -1372,8 +1379,8 @@ { scr_blank_screen_mem (ROW(row), rstyle); - if (!view_start) - scr_blank_line (drawn_buf [row], 0, ncol, ren); + if (row - view_start < nrow) + scr_blank_line (drawn_buf [row - view_start], 0, ncol, ren); } } @@ -2680,7 +2687,7 @@ * Paste a selection direct to the command fd */ void -rxvt_term::paste (char *data, unsigned int len) NOTHROW +rxvt_term::tt_paste (char *data, unsigned int len) NOTHROW { /* convert normal newline chars into common keyboard Return key sequence */ for (unsigned int i = 0; i < len; i++) @@ -2696,6 +2703,15 @@ tt_printf ("\e[201~"); } +void +rxvt_term::paste (char *data, unsigned int len) NOTHROW +{ + if (HOOK_INVOKE ((this, HOOK_TT_PASTE, DT_STR_LEN, data, len, DT_END))) + return; + + tt_paste (data, len); +} + /* ------------------------------------------------------------------------- */ /* * Respond to a notification that a primary selection has been sent @@ -2978,20 +2994,6 @@ } } -void -rxvt_term::clipboard_copy (Time tm) -{ - if (selection.len > 0) - { - free (selection.clip_text); - selection.clip_len = selection.len; - selection.clip_text = (wchar_t *) malloc (sizeof (wchar_t) * selection.clip_len); - memcpy (selection.clip_text, selection.text, - sizeof (wchar_t) * selection.clip_len); - selection_grab (tm, true); - } -} - /* ------------------------------------------------------------------------- */ /* * Copy a selection into the cut buffer