ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/command.C
(Generate patch)

Comparing rxvt-unicode/src/command.C (file contents):
Revision 1.59 by pcg, Wed Feb 25 15:39:48 2004 UTC vs.
Revision 1.64 by pcg, Wed Mar 3 04:07:52 2004 UTC

291 ^ !!ctrl) ? '\b' : '\177'; 291 ^ !!ctrl) ? '\b' : '\177';
292 kbuf[1] = '\0'; 292 kbuf[1] = '\0';
293 } 293 }
294 else 294 else
295 STRCPY (kbuf, key_backspace); 295 STRCPY (kbuf, key_backspace);
296# ifdef MULTICHAR_SET
297 if ((Options & Opt_mc_hack) && screen.cur.col > 0)
298 {
299 int col, row;
300
301 newlen = STRLEN (kbuf);
302 col = screen.cur.col - 1;
303 row = screen.cur.row + TermWin.saveLines;
304 if (IS_MULTI2 (screen.rend[row][col]))
305 MEMMOVE (kbuf + newlen, kbuf, newlen + 1);
306 }
307# endif
308 break; 296 break;
309#endif 297#endif
310#ifndef NO_DELETE_KEY 298#ifndef NO_DELETE_KEY
311 case XK_Delete: 299 case XK_Delete:
312 STRCPY (kbuf, key_delete); 300 STRCPY (kbuf, key_delete);
313# ifdef MULTICHAR_SET
314 if (Options & Opt_mc_hack)
315 {
316 int col, row;
317
318 newlen = STRLEN (kbuf);
319 col = screen.cur.col;
320 row = screen.cur.row + TermWin.saveLines;
321 if (IS_MULTI1 (screen.rend[row][col]))
322 MEMMOVE (kbuf + newlen, kbuf, newlen + 1);
323 }
324# endif
325 break; 301 break;
326#endif 302#endif
327 case XK_Tab: 303 case XK_Tab:
328 if (shft) 304 if (shft)
329 STRCPY (kbuf, "\033[Z"); 305 STRCPY (kbuf, "\033[Z");
371 kbuf[1] = 'O'; 347 kbuf[1] = 'O';
372 kbuf[2] = "dacb"[keysym - XK_Left]; 348 kbuf[2] = "dacb"[keysym - XK_Left];
373 } 349 }
374 else if (PrivateModes & PrivMode_aplCUR) 350 else if (PrivateModes & PrivMode_aplCUR)
375 kbuf[1] = 'O'; 351 kbuf[1] = 'O';
376#ifdef MULTICHAR_SET
377 //TODO: ??
378 if (Options & Opt_mc_hack)
379 {
380 int col, row, m;
381
382 col = screen.cur.col;
383 row = screen.cur.row + TermWin.saveLines;
384 m = 0;
385 if (keysym == XK_Right
386 && IS_MULTI1 (screen.rend[row][col]))
387 m = 1;
388 else if (keysym == XK_Left)
389 {
390 if (col > 0)
391 {
392 if (IS_MULTI2 (screen.rend[row][col - 1]))
393 m = 1;
394 }
395 else if (screen.cur.row > 0)
396 {
397 col = screen.tlen[--row];
398 if (col == -1)
399 col = TermWin.ncol - 1;
400 else
401 col--;
402 if (col > 0
403 && IS_MULTI2 (screen.rend[row][col]))
404 m = 1;
405 }
406 }
407 if (m)
408 MEMMOVE (kbuf + 3, kbuf, 3 + 1);
409 }
410#endif
411 break; 352 break;
412 353
413#ifndef UNSHIFTED_SCROLLKEYS 354#ifndef UNSHIFTED_SCROLLKEYS
414# ifdef XK_KP_Prior 355# ifdef XK_KP_Prior
415 case XK_KP_Prior: 356 case XK_KP_Prior:
942uint32_t 883uint32_t
943rxvt_term::next_char () 884rxvt_term::next_char ()
944{ 885{
945 while (cmdbuf_ptr < cmdbuf_endp) 886 while (cmdbuf_ptr < cmdbuf_endp)
946 { 887 {
947 if (*cmdbuf_ptr < 0x80) // assume < 0x80 to be ascii ALWAYS (all shift-states etc.) uh-oh 888 // assume 0x20 .. 0x7f to be ascii ALWAYS (all shift-states etc.) uh-oh
889 if ((*cmdbuf_ptr <= 0x7f && 0x20 <= *cmdbuf_ptr)
890 || !*cmdbuf_ptr)
948 return *cmdbuf_ptr++; 891 return *cmdbuf_ptr++;
949 892
950 wchar_t wc; 893 wchar_t wc;
951 size_t len = mbrtowc (&wc, (char *)cmdbuf_ptr, cmdbuf_endp - cmdbuf_ptr, mbstate); 894 size_t len = mbrtowc (&wc, (char *)cmdbuf_ptr, cmdbuf_endp - cmdbuf_ptr, mbstate);
952 895
953 if (len == (size_t)-2) 896 if (len == (size_t)-2)
954 return NOCHAR; 897 {
898 // the mbstate stores incomplete sequences. didn't know this :/
899 cmdbuf_ptr = cmdbuf_endp;
900 break;
901 }
955 902
956 if (len == (size_t)-1) 903 if (len == (size_t)-1)
957 return *cmdbuf_ptr++; // the _occasional_ latin1 character is allowed to slip through 904 return *cmdbuf_ptr++; // the _occasional_ latin1 character is allowed to slip through
958 905
959 // assume wchar == unicode 906 // assume wchar == unicode
2360 scr_charset_set (2, (unsigned int)cmd_getc ()); 2307 scr_charset_set (2, (unsigned int)cmd_getc ());
2361 break; 2308 break;
2362 case '+': 2309 case '+':
2363 scr_charset_set (3, (unsigned int)cmd_getc ()); 2310 scr_charset_set (3, (unsigned int)cmd_getc ());
2364 break; 2311 break;
2365#ifdef MULTICHAR_SET
2366 case '$':
2367 scr_charset_set (-2, (unsigned int)cmd_getc ());
2368 break;
2369#endif
2370#ifndef NO_FRILLS 2312#ifndef NO_FRILLS
2371 case '6': 2313 case '6':
2372 scr_backindex (); 2314 scr_backindex ();
2373 break; 2315 break;
2374#endif 2316#endif
2715 case 7: /* unofficial extension */ 2657 case 7: /* unofficial extension */
2716 tt_printf ("%-.250s\n", rs[Rs_display_name]); 2658 tt_printf ("%-.250s\n", rs[Rs_display_name]);
2717 break; 2659 break;
2718#endif 2660#endif
2719 case 8: /* unofficial extension */ 2661 case 8: /* unofficial extension */
2720 xterm_seq (XTerm_title, APL_NAME "-" VERSION, CHAR_ST); 2662 xterm_seq (XTerm_title, RESNAME "-" VERSION, CHAR_ST);
2721 break; 2663 break;
2722 } 2664 }
2723 break; 2665 break;
2724 2666
2725 case CSI_TBC: /* 8.3.155: (0) TABULATION CLEAR */ 2667 case CSI_TBC: /* 8.3.155: (0) TABULATION CLEAR */
3097 case XTerm_logfile: 3039 case XTerm_logfile:
3098 break; 3040 break;
3099 case XTerm_font: 3041 case XTerm_font:
3100 change_font (str); 3042 change_font (str);
3101 break; 3043 break;
3044#ifndef NO_FRILLS
3102 case XTerm_locale: 3045 case XTerm_locale:
3103 if (str[0] == '?' && !str[1]) 3046 if (str[0] == '?' && !str[1])
3104 tt_printf ("%-.250s\n", locale); 3047 tt_printf ("%-.250s\n", locale);
3105 else 3048 else
3106 { 3049 {
3107 set_locale (str); 3050 set_locale (str);
3051# ifdef USE_XIM
3108 im_cb (); 3052 im_cb ();
3109 3053# endif
3110 // TODO: call selection_make with the right values set 3054 // TODO: call selection_make with the right values set
3111 // to re-fresh the selection. 3055 // to re-fresh the selection.
3112 if (display->selection_owner == this) 3056 if (display->selection_owner == this)
3113 display->set_selection_owner (0); 3057 display->set_selection_owner (0);
3114 } 3058 }
3115 break; 3059 break;
3060#endif
3116#if 0 3061#if 0
3117 case XTerm_dumpscreen: /* no error notices */ 3062 case XTerm_dumpscreen: /* no error notices */
3118 { 3063 {
3119 int fd; 3064 int fd;
3120 if ((fd = open (str, O_RDWR | O_CREAT | O_EXCL, 0600)) >= 0) 3065 if ((fd = open (str, O_RDWR | O_CREAT | O_EXCL, 0600)) >= 0)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines