rxvt_term::cmd_parse ()
{
bool flag = false;
- uint32_t ch = NOCHAR;
+ unicode_t ch = NOCHAR;
for (;;)
{
if (ch >= ' ' || ch == '\t' || ch == '\n' || ch == '\r')
{
/* Read a text string from the input buffer */
- uint32_t buf[BUFSIZ];
+ unicode_t buf[BUFSIZ];
bool refreshnow = false;
int nlines = 0;
- uint32_t *str = buf;
+ unicode_t *str = buf;
*str++ = ch;
// read the next character, currently handles UTF-8
// will probably handle all sorts of other stuff in the future
-uint32_t
+unicode_t
rxvt_term::next_char ()
{
while (cmdbuf_ptr < cmdbuf_endp)
* Return the next input character after first passing any keyboard input
* to the command.
*/
-uint32_t
+unicode_t
rxvt_term::cmd_getc ()
{
for (;;)
{
- uint32_t c = next_char ();
+ unicode_t c = next_char ();
if (c != NOCHAR)
return c;
/* 8.3.87: NEXT LINE */
case C1_NEL: /* ESC E */
{
- uint32_t nlcr[] = { '\n', '\r' };
+ unicode_t nlcr[] = { L'\n', L'\r' };
scr_add_lines (nlcr, 1, 2);
}
break;
#ifdef scrollBar_esc
{ scrollBar_esc, PrivMode_scrollBar },
#endif
+ // 18, 19 printing-related
{ 25, PrivMode_VisibleCursor },
- { 35, PrivMode_ShiftKeys },
+ // 30 show scrollbar rxvt. extension
+ { 35, PrivMode_ShiftKeys }, // rxvt extension
{ 40, PrivMode_132OK },
+ // 41 xterm more fixes NYI
+ // 45 margin bell NYI
+ // 46 start logging
{ 47, PrivMode_Screen },
{ 66, PrivMode_aplKP },
#ifndef NO_BACKSPACE_KEY
{ 67, PrivMode_BackSpace },
#endif
{ 1000, PrivMode_MouseX11 },
- { 1010, PrivMode_TtyOutputInh },
- { 1011, PrivMode_Keypress },
+ // 1001 Use Hilite Mouse Tracking. NYI, TODO
+ // 1002 Use Cell Motion Mouse Tracking. NYI, TODO
+ // 1003 Use All Motion Mouse Tracking. NYI, TODO
+ { 1010, PrivMode_TtyOutputInh }, // rxvt extension
+ { 1011, PrivMode_Keypress }, // rxvt extension
+ // 1035 enable modifiers for alt, numlock NYI
+ // 1036 send ESC for meta keys NYI
+ // 1037 send DEL for keypad delete NYI
{ 1047, PrivMode_Screen },
+ // 1048 save and restore cursor
{ 1049, PrivMode_Screen }, /* xterm extension, not fully implemented */
+ // 1051, 1052, 1060, 1061 keyboard emulation NYI
};
if (nargs == 0)
}
/* extra handling for values with state unkept */
- if (state == -1)
- switch (arg[i])
- {
- case 1048: /* alternative cursor save */
- if (mode == 0)
- scr_cursor (RESTORE);
- else if (mode == 1)
- scr_cursor (SAVE);
- /* FALLTHROUGH */
- default:
- continue; /* for (;i;) */
- }
-
- /* extra handling for values with valid 0 or 1 state */
switch (arg[i])
{
- /* case 1: - application cursor keys */
- case 2: /* VT52 mode */
- /* oddball mode. should be set regardless of set/reset
- * parameter. Return from VT52 mode with an ESC < from
- * within VT52 mode
- */
- PrivMode (1, PrivMode_vt52);
- break;
- case 3: /* 80/132 */
- if (PrivateModes & PrivMode_132OK)
- set_widthheight (((state ? 132 : 80) * TermWin.fwidth), TermWin.height);
- break;
- case 4: /* smooth scrolling */
- if (state)
- Options &= ~Opt_jumpScroll;
- else
- Options |= Opt_jumpScroll;
- break;
- case 5: /* reverse video */
- scr_rvideo_mode (state);
- break;
- case 6: /* relative/absolute origins */
- scr_relative_origin (state);
- break;
- case 7: /* autowrap */
- scr_autowrap (state);
- break;
- /* case 8: - auto repeat, can't do on a per window basis */
- case 9: /* X10 mouse reporting */
- if (state) /* orthogonal */
- PrivateModes &= ~ (PrivMode_MouseX11);
- break;
+ case 1048: /* alternative cursor save */
+ case 1049:
+ if (mode == 0)
+ scr_cursor (RESTORE);
+ else if (mode == 1)
+ scr_cursor (SAVE);
+ /* FALLTHROUGH */
+ }
+
+ if (state >= 0)
+ /* extra handling for values with valid 0 or 1 state */
+ switch (arg[i])
+ {
+ /* case 1: - application cursor keys */
+ case 2: /* VT52 mode */
+ /* oddball mode. should be set regardless of set/reset
+ * parameter. Return from VT52 mode with an ESC < from
+ * within VT52 mode
+ */
+ PrivMode (1, PrivMode_vt52);
+ break;
+ case 3: /* 80/132 */
+ if (PrivateModes & PrivMode_132OK)
+ set_widthheight (((state ? 132 : 80) * TermWin.fwidth), TermWin.height);
+ break;
+ case 4: /* smooth scrolling */
+ if (state)
+ Options &= ~Opt_jumpScroll;
+ else
+ Options |= Opt_jumpScroll;
+ break;
+ case 5: /* reverse video */
+ scr_rvideo_mode (state);
+ break;
+ case 6: /* relative/absolute origins */
+ scr_relative_origin (state);
+ break;
+ case 7: /* autowrap */
+ scr_autowrap (state);
+ break;
+ /* case 8: - auto repeat, can't do on a per window basis */
+ case 9: /* X10 mouse reporting */
+ if (state) /* orthogonal */
+ PrivateModes &= ~ (PrivMode_MouseX11);
+ break;
#ifdef menuBar_esc
- case menuBar_esc:
+ case menuBar_esc:
#ifdef MENUBAR
- map_menuBar (state);
+ map_menuBar (state);
#endif
- break;
+ break;
#endif
#ifdef scrollBar_esc
- case scrollBar_esc:
- if (scrollbar_mapping (state))
- {
- resize_all_windows (0, 0, 0);
- scr_touch (true);
- }
- break;
+ case scrollBar_esc:
+ if (scrollbar_mapping (state))
+ {
+ resize_all_windows (0, 0, 0);
+ scr_touch (true);
+ }
+ break;
#endif
- case 25: /* visible/invisible cursor */
- scr_cursor_visible (state);
- break;
- /* case 35: - shift keys */
- /* case 40: - 80 <--> 132 mode */
- case 47: /* secondary screen */
- scr_change_screen (state);
- break;
- /* case 66: - application key pad */
- /* case 67: - backspace key */
- case 1000: /* X11 mouse reporting */
- if (state) /* orthogonal */
- PrivateModes &= ~ (PrivMode_MouseX10);
- break;
+ case 25: /* visible/invisible cursor */
+ scr_cursor_visible (state);
+ break;
+ /* case 35: - shift keys */
+ /* case 40: - 80 <--> 132 mode */
+ case 47: /* secondary screen */
+ scr_change_screen (state);
+ break;
+ /* case 66: - application key pad */
+ /* case 67: - backspace key */
+ case 1000: /* X11 mouse reporting */
+ if (state) /* orthogonal */
+ PrivateModes &= ~ (PrivMode_MouseX10);
+ break;
#if 0
- case 1001:
- break; /* X11 mouse highlighting */
+ case 1001:
+ break; /* X11 mouse highlighting */
#endif
- case 1010: /* scroll to bottom on TTY output inhibit */
- if (state)
- Options &= ~Opt_scrollTtyOutput;
- else
- Options |= Opt_scrollTtyOutput;
- break;
- case 1011: /* scroll to bottom on key press */
- if (state)
- Options |= Opt_scrollTtyKeypress;
- else
- Options &= ~Opt_scrollTtyKeypress;
- break;
- case 1047: /* secondary screen w/ clearing */
- case 1049: /* better secondary screen w/ clearing, but not fully implemented */
- if (current_screen != PRIMARY)
- scr_erase_screen (2);
- scr_change_screen (state);
- /* FALLTHROUGH */
- default:
- break;
- }
+ case 1010: /* scroll to bottom on TTY output inhibit */
+ if (state)
+ Options &= ~Opt_scrollTtyOutput;
+ else
+ Options |= Opt_scrollTtyOutput;
+ break;
+ case 1011: /* scroll to bottom on key press */
+ if (state)
+ Options |= Opt_scrollTtyKeypress;
+ else
+ Options &= ~Opt_scrollTtyKeypress;
+ break;
+ case 1047: /* secondary screen w/ clearing */
+ case 1049: /* better secondary screen w/ clearing, but not fully implemented */
+ if (current_screen != PRIMARY)
+ scr_erase_screen (2);
+ scr_change_screen (state);
+ /* FALLTHROUGH */
+ default:
+ break;
+ }
}
}
/*}}} */
case 7:
rendset = 1, rendstyle = RS_RVid;
break;
+ case 8:
+ // invisible. NYI
+ break;
case 22:
rendset = 0, rendstyle = RS_Bold;
break;
case 27:
rendset = 0, rendstyle = RS_RVid;
break;
+ case 28:
+ // visible. NYI
+ break;
}
+
if (rendset != -1)
{
scr_rendition (rendset, rendstyle);
case 35:
case 36:
case 37:
- scr_color ((unsigned int) (minCOLOR + (arg[i] - 30)),
- Color_fg);
+ scr_color ((unsigned int) (minCOLOR + (arg[i] - 30)), Color_fg);
break;
#ifdef TTY_256COLOR
case 38:
if (nargs > i + 2 && arg[i + 1] == 5)
{
- scr_color ((unsigned int) (minCOLOR + arg[i + 2]),
- Color_fg);
+ scr_color ((unsigned int) (minCOLOR + arg[i + 2]), Color_fg);
i += 2;
}
break;
case 45:
case 46:
case 47:
- scr_color ((unsigned int) (minCOLOR + (arg[i] - 40)),
- Color_bg);
+ scr_color ((unsigned int) (minCOLOR + (arg[i] - 40)), Color_bg);
break;
#ifdef TTY_256COLOR
case 48:
if (nargs > i + 2 && arg[i + 1] == 5)
{
- scr_color ((unsigned int) (minCOLOR + arg[i + 2]),
- Color_bg);
+ scr_color ((unsigned int) (minCOLOR + arg[i + 2]), Color_bg);
i += 2;
}
break;
return true;
}
- bool has_codepoint (uint32_t unicode)
+ bool has_codepoint (unicode_t unicode)
{
if (unicode <= 0x001f)
return true;
bool load (const rxvt_fontprop &prop);
- bool has_codepoint (uint32_t unicode);
+ bool has_codepoint (unicode_t unicode);
void draw (rxvt_drawable &d, int x, int y,
const text_t *text, int len,
}
bool
-rxvt_font_x11::has_codepoint (uint32_t unicode)
+rxvt_font_x11::has_codepoint (unicode_t unicode)
{
uint32_t ch = FROM_UNICODE (cs, unicode);
const text_t *text, int len,
int fg, int bg);
- bool has_codepoint (uint32_t unicode);
+ bool has_codepoint (unicode_t unicode);
protected:
XftFont *f;
}
bool
-rxvt_font_xft::has_codepoint (uint32_t unicode)
+rxvt_font_xft::has_codepoint (unicode_t unicode)
{
return XftCharExists (DISPLAY, f, unicode);
}
}
int
-rxvt_fontset::find_font (uint32_t unicode)
+rxvt_fontset::find_font (unicode_t unicode)
{
for (unsigned int i = 0; i < fonts.size (); i++)
{
#if ENABLE_COMBINING
class rxvt_composite_vec rxvt_composite;
-text_t rxvt_composite_vec::compose (uint32_t c1, uint32_t c2)
+text_t rxvt_composite_vec::compose (unicode_t c1, unicode_t c2)
{
compose_char *cc;
return v.size () - 1 + COMPOSE_LO;
}
-int rxvt_composite_vec::expand (uint32_t c, wchar_t *r)
+int rxvt_composite_vec::expand (unicode_t c, wchar_t *r)
{
compose_char *cc = (*this)[c];
#include <X11/keysymdef.h>
#include <X11/Xatom.h>
+#include "encoding.h"
#include "defaultfont.h"
#include "rxvtcolor.h"
#include "iom.h"
*****************************************************************************
*/
-#if defined (NO_OLD_SELECTION) && defined(NO_NEW_SELECTION)
-# error if you disable both selection styles, how can you select, silly?
-#endif
-
/* COLORTERM, TERM environment variables */
#define COLORTERMENV "rxvt"
#ifdef XPM_BACKGROUND
// that are not representable in unicode, as well as characters
// not fitting in the BMP.
struct compose_char {
- uint32_t c1, c2; // any chars != NOCHAR are valid
- compose_char (uint32_t c1, uint32_t c2)
+ unicode_t c1, c2; // any chars != NOCHAR are valid
+ compose_char (unicode_t c1, unicode_t c2)
: c1(c1), c2(c2)
{ }
};
class rxvt_composite_vec {
vector<compose_char> v;
public:
- text_t compose (uint32_t c1, uint32_t c2 = NOCHAR);
- int expand (uint32_t c, wchar_t *r);
+ text_t compose (unicode_t c1, unicode_t c2 = NOCHAR);
+ int expand (unicode_t c, wchar_t *r);
compose_char *operator [](text_t c)
{
return c >= COMPOSE_LO && c < COMPOSE_LO + v.size ()
bool init (int argc, const char *const *argv);
bool init_vars ();
- uint32_t next_char ();
+ unicode_t next_char ();
bool pty_fill ();
// command.C
void lookup_key (XKeyEvent &ev);
unsigned int cmd_write (const unsigned char *str, unsigned int count);
- uint32_t cmd_getc ();
+ unicode_t cmd_getc ();
bool cmd_parse ();
void mouse_report (XButtonEvent &ev);
void button_press (XButtonEvent &ev);
int scr_change_screen (int scrn);
void scr_color (unsigned int color, int fgbg);
void scr_rendition (int set, int style);
- void scr_add_lines (const uint32_t *str, int nlines, int len);
+ void scr_add_lines (const unicode_t *str, int nlines, int len);
void scr_backspace ();
void scr_tab (int count);
void scr_backindex ();
* Add text given in <str> of length <len> to screen struct
*/
void
-rxvt_term::scr_add_lines (const uint32_t *str, int nlines, int len)
+rxvt_term::scr_add_lines (const unicode_t *str, int nlines, int len)
{
unsigned char checksel, clearsel;
- uint32_t c;
+ unicode_t c;
int i, row, last_col;
text_t *stp;
rend_t *srp;
*tp = ' '; // hack //D //TODO //--tp, --rp;
// first try to find a precomposed character
- uint32_t n = rxvt_compose (*tp, c);
+ unicode_t n = rxvt_compose (*tp, c);
if (n == NOCHAR)
n = rxvt_composite.compose (*tp, c);
new_selection_text[ofs++] = L'\n';
}
-#ifndef NO_OLD_SELECTION
- if (selection_style == OLD_SELECT)
- if (end_col == TermWin.ncol)
- new_selection_text[ofs++] = L'\n';
-#endif
-#ifndef NO_NEW_SELECTION
- if (selection_style != OLD_SELECT)
- if (end_col != selection.end.col)
- new_selection_text[ofs++] = L'\n';
-#endif
+ if (end_col != selection.end.col)
+ new_selection_text[ofs++] = L'\n';
+
new_selection_text[ofs] = 0;
if (ofs == 0)
want_refresh = 1;
selection.mark.col = col;
selection.mark.row = row - TermWin.view_start;
+
MAX_IT (selection.mark.row, - (int32_t)TermWin.nscrolled);
MIN_IT (selection.mark.row, (int32_t)TermWin.nrow - 1);
MAX_IT (selection.mark.col, 0);
MIN_IT (selection.mark.col, (int32_t)TermWin.ncol - 1);
+ while (selection.mark.col > 0
+ && screen.text[selection.mark.row + TermWin.saveLines][selection.mark.col] == NOCHAR)
+ --selection.mark.col;
+
if (selection.op)
{ /* clear the old selection */
selection.beg.row = selection.end.row = selection.mark.row;
selection.beg.col = selection.end.col = selection.mark.col;
}
+
selection.op = SELECTION_INIT;
selection.screen = current_screen;
}
*/
/* what do we want: spaces/tabs are delimiters or cutchars or non-cutchars */
-#define DELIMIT_TEXT(x) \
- (((x) == ' ' || (x) == '\t') ? 2 : (STRCHR (rs[Rs_cutchars], (x)) != NULL))
+#define DELIMIT_TEXT(x) \
+ (unicode::is_space (x) ? 2 : (x) <= 0xff && !!STRCHR (rs[Rs_cutchars], (x)))
#define DELIMIT_REND(x) 1
void
rxvt_term::selection_delimit_word (enum page_dirn dirn, const row_col_t *mark, row_col_t *ret)
{
- int col, row, dirnadd, tcol, trow, w1, w2;
- row_col_t bound;
- text_t *stp;
- rend_t *srp;
+ int col, row, dirnadd, tcol, trow, w1, w2;
+ row_col_t bound;
+ text_t *stp;
+ rend_t *srp;
if (dirn == UP)
{
bound.col = TermWin.ncol - 1;
dirnadd = 1;
}
+
row = mark->row + TermWin.saveLines;
col = mark->col;
MAX_IT (col, 0);
stp = & (screen.text[row][col]);
w1 = DELIMIT_TEXT (*stp);
- if (selection_style != NEW_SELECT)
- {
- if (w1 == 1)
- {
- stp += dirnadd;
- if (DELIMIT_TEXT (*stp) == 1)
- goto Old_Word_Selection_You_Die;
- col += dirnadd;
- }
- w1 = 0;
- }
srp = (&screen.rend[row][col]);
w2 = DELIMIT_REND (*srp);
for (; col != bound.col; col += dirnadd)
{
stp += dirnadd;
+ srp += dirnadd;
+
+ if (*stp == NOCHAR)
+ continue;
+
if (DELIMIT_TEXT (*stp) != w1)
break;
- srp += dirnadd;
if (DELIMIT_REND (*srp) != w2)
break;
}
+
if ((col == bound.col) && (row != bound.row))
{
if (screen.tlen[ (row - (dirn == UP ? 1 : 0))] == -1)
{
trow = row + dirnadd;
tcol = dirn == UP ? TermWin.ncol - 1 : 0;
+
if (screen.text[trow] == NULL)
break;
+
stp = & (screen.text[trow][tcol]);
srp = & (screen.rend[trow][tcol]);
+
if (DELIMIT_TEXT (*stp) != w1 || DELIMIT_REND (*srp) != w2)
break;
+
row = trow;
col = tcol;
continue;
}
break;
}
+
Old_Word_Selection_You_Die:
D_SELECT ((stderr, "rxvt_selection_delimit_word (%s,...) @ (r:%3d, c:%3d) has boundary (r:%3d, c:%3d)", (dirn == UP ? "up " : "down"), mark->row, mark->col, row - TermWin.saveLines, col));
MAX_IT (col, 0);
MIN_IT (col, (int)TermWin.ncol);
-#ifndef NO_NEW_SELECTION
/*
* If we're selecting characters (single click) then we must check first
* if we are at the same place as the original mark. If we are then
* select nothing. Otherwise, if we're to the right of the mark, you have to
* be _past_ a character for it to be selected.
*/
- if (selection_style != OLD_SELECT)
- {
- if (((selection.clicks % 3) == 1) && !flag
- && (col == selection.mark.col
- && (row == selection.mark.row + TermWin.view_start)))
- {
- /* select nothing */
- selection.beg.row = selection.end.row = 0;
- selection.beg.col = selection.end.col = 0;
- selection.clicks = 4;
- want_refresh = 1;
- D_SELECT ((stderr, "rxvt_selection_extend () selection.clicks = 4"));
- return;
- }
+ if (((selection.clicks % 3) == 1) && !flag
+ && (col == selection.mark.col
+ && (row == selection.mark.row + TermWin.view_start)))
+ {
+ /* select nothing */
+ selection.beg.row = selection.end.row = 0;
+ selection.beg.col = selection.end.col = 0;
+ selection.clicks = 4;
+ want_refresh = 1;
+ D_SELECT ((stderr, "rxvt_selection_extend () selection.clicks = 4"));
+ return;
}
-#endif
+
if (selection.clicks == 4)
selection.clicks = 1;
pos.row -= TermWin.view_start; /* adjust for scroll */
-#ifndef NO_OLD_SELECTION
- /*
- * This mimics some of the selection behaviour of version 2.20 and before.
- * There are no ``selection modes'', button3 is always character extension.
- * Note: button3 drag is always available, c.f. v2.20
- * Selection always terminates (left or right as appropriate) at the mark.
- */
- if (selection_style == OLD_SELECT)
- {
- if (selection.clicks == 1 || button3)
- {
- if (hate_those_clicks)
- {
- hate_those_clicks = 0;
- if (selection.clicks == 1)
- {
- selection.beg.row = selection.mark.row;
- selection.beg.col = selection.mark.col;
- }
- else
- {
- selection.mark.row = selection.beg.row;
- selection.mark.col = selection.beg.col;
- }
- }
- if (ROWCOL_IS_BEFORE (pos, selection.mark))
- {
- selection.end.row = selection.mark.row;
- selection.end.col = selection.mark.col + 1;
- selection.beg.row = pos.row;
- selection.beg.col = pos.col;
- }
- else
- {
- selection.beg.row = selection.mark.row;
- selection.beg.col = selection.mark.col;
- selection.end.row = pos.row;
- selection.end.col = pos.col + 1;
- }
- }
- else if (selection.clicks == 2)
- {
- selection_delimit_word (UP, & (selection.mark),
- & (selection.beg));
- selection_delimit_word (DN, & (selection.mark),
- & (selection.end));
- hate_those_clicks = 1;
- }
- else if (selection.clicks == 3)
- {
- selection.beg.row = selection.end.row = selection.mark.row;
- selection.beg.col = 0;
- selection.end.col = ncol;
- hate_those_clicks = 1;
- }
- D_SELECT ((stderr, "rxvt_selection_extend_colrow () EXIT b: (r:%d,c:%d) m: (r:%d,c:%d), e: (r:%d,c:%d)", selection.beg.row, selection.beg.col, selection.mark.row, selection.mark.col, selection.end.row, selection.end.col));
- return;
- }
-#endif /* ! NO_OLD_SELECTION */
-#ifndef NO_NEW_SELECTION
- /* selection_style must not be OLD_SELECT to get here */
/*
* This is mainly xterm style selection with a couple of differences, mainly
* in the way button3 drag extension works.
* time of the most recent button3 press
*/
if (button3 && buttonpress)
- { /* button3 press */
+ { /* button3 press */
/*
* first determine which edge of the selection we are closest to
*/
< ((selection.end.col - pos.col)
+ ((selection.end.row - pos.row) * ncol)))))
closeto = LEFT;
+
if (closeto == LEFT)
{
selection.beg.row = pos.row;
selection.beg.col = pos.col;
selection.mark.row = selection.end.row;
- selection.mark.col = selection.end.col
- - (selection.clicks == 2);
+ selection.mark.col = selection.end.col - (selection.clicks == 2);
}
else
{
}
}
else
- { /* button1 drag or button3 drag */
+ { /* button1 drag or button3 drag */
if (ROWCOL_IS_AFTER (selection.mark, pos))
{
if ((selection.mark.row == selection.end.row)
&& (selection.mark.col == selection.end.col)
&& clickchange && selection.clicks == 2)
selection.mark.col--;
+
selection.beg.row = pos.row;
selection.beg.col = pos.col;
selection.end.row = selection.mark.row;
- selection.end.col = selection.mark.col
- + (selection.clicks == 2);
+ selection.end.col = selection.mark.col + (selection.clicks == 2);
}
else
{
if (selection.clicks == 1)
{
end_col = screen.tlen[selection.beg.row + TermWin.saveLines];
+
if (end_col != -1 && selection.beg.col > end_col)
{
#if 1
else
selection.beg.col = selection.mark.col;
#endif
-
}
+
end_col = screen.tlen[selection.end.row + TermWin.saveLines];
+
if (end_col != -1 && selection.end.col > end_col)
selection.end.col = ncol;
-
}
else if (selection.clicks == 2)
{
if (ROWCOL_IS_AFTER (selection.end, selection.beg))
selection.end.col--;
- selection_delimit_word (UP, & (selection.beg),
- & (selection.beg));
- selection_delimit_word (DN, & (selection.end),
- & (selection.end));
+
+ selection_delimit_word (UP, & (selection.beg), & (selection.beg));
+ selection_delimit_word (DN, & (selection.end), & (selection.end));
}
else if (selection.clicks == 3)
{
#ifndef NO_FRILLS
if ((Options & Opt_tripleclickwords))
{
- int end_row;
-
- selection_delimit_word (UP, & (selection.beg),
- & (selection.beg));
- end_row = screen.tlen[selection.mark.row
- + TermWin.saveLines];
- for (end_row = selection.mark.row; end_row < TermWin.nrow;
- end_row++)
+ int end_row;
+
+ selection_delimit_word (UP, & (selection.beg), & (selection.beg));
+ end_row = screen.tlen[selection.mark.row + TermWin.saveLines];
+
+ for (end_row = selection.mark.row; end_row < TermWin.nrow; end_row++)
{
end_col = screen.tlen[end_row + TermWin.saveLines];
+
if (end_col != -1)
{
selection.end.row = end_row;
}
else
#endif
-
{
if (ROWCOL_IS_AFTER (selection.mark, selection.beg))
selection.mark.col++;
selection.end.col = ncol;
}
}
+
if (button3 && buttonpress)
- { /* mark may need to be changed */
+ { /* mark may need to be changed */
if (closeto == LEFT)
{
selection.mark.row = selection.end.row;
}
}
D_SELECT ((stderr, "rxvt_selection_extend_colrow () EXIT b: (r:%d,c:%d) m: (r:%d,c:%d), e: (r:%d,c:%d)", selection.beg.row, selection.beg.col, selection.mark.row, selection.mark.col, selection.end.row, selection.end.col));
-#endif /* ! NO_NEW_SELECTION */
}
#ifndef NO_FRILLS
};
struct rxvt_codeset_conv_jis0208_1983_0 : rxvt_codeset_conv {
- uint32_t from_unicode (uint32_t unicode) const {
+ uint32_t from_unicode (unicode_t unicode) const {
if (unicode == 0x2312) return 0x225e;
uint8_t l = unicode;
uint16_t h = unicode >> 8;
: NOCHAR;
return NOCHAR;
}
- uint32_t to_unicode (uint32_t enc) const {
+ unicode_t to_unicode (uint32_t enc) const {
if (enc <= 0x2421 && 0x2473 <= enc) return enc + 0x0c20;
if (enc <= 0x2521 && 0x2576 <= enc) return enc + 0x0b80;
uint8_t l = enc;