* More advanced example: L" `'\"()[]{}"
*/
wchar_t *worddelimiters = L" ";
+wchar_t *snap_line_delimiters = L"│";
/* selection timeouts (in milliseconds) */
static unsigned int doubleclicktimeout = 300;
#define ISCONTROLC1(c) (BETWEEN(c, 0x80, 0x9f))
#define ISCONTROL(c) (ISCONTROLC0(c) || ISCONTROLC1(c))
#define ISDELIM(u) (u && wcschr(worddelimiters, u))
+#define IS_SNAP_LINE_DELIM(u) (u && wcschr(snap_line_delimiters, u))
enum term_mode {
MODE_WRAP = 1 << 0,
}
break;
case SNAP_LINE:
+ /*
+ * Don't snap past a line snap delimiter
+ * (see 'snap_line_delimiters' in config.h)
+ */
+ for(;;) {
+ newx = *x + direction;
+
+ if (!BETWEEN(newx, 0, term.col - 1)) {
+ break;
+ }
+
+ gp = &term.line[*y][newx];
+
+ if(IS_SNAP_LINE_DELIM(gp->u)) {
+ break;
+ }
+
+ *x = newx;
+ }
+
/*
* Snap around if the the previous line or the current one
* has set ATTR_WRAP at its end. Then the whole next or
* previous line will be selected.
*/
- *x = (direction < 0) ? 0 : term.col - 1;
if (direction < 0) {
for (; *y > 0; *y += direction) {
if (!(term.line[*y-1][term.col-1].mode
extern char *stty_args;
extern char *vtiden;
extern wchar_t *worddelimiters;
+extern wchar_t *snap_line_delimiters;
extern int allowaltscreen;
extern int allowwindowops;
extern char *termname;