Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157514667
D56922.id177683.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D56922.id177683.diff
View Options
diff --git a/sys/dev/vt/vt.h b/sys/dev/vt/vt.h
--- a/sys/dev/vt/vt.h
+++ b/sys/dev/vt/vt.h
@@ -248,6 +248,8 @@
int vtbuf_set_mark(struct vt_buf *vb, int type, int col, int row);
int vtbuf_get_marked_len(struct vt_buf *vb);
void vtbuf_extract_marked(struct vt_buf *vb, term_char_t *buf, int sz, int mark);
+void vtbuf_unmark(struct vt_buf *vb);
+void vtbuf_unmark_on_cross(struct vt_buf *vb, int target_begin, int target_end);
#endif
#define VTB_MARK_NONE 0
diff --git a/sys/dev/vt/vt_buf.c b/sys/dev/vt/vt_buf.c
--- a/sys/dev/vt/vt_buf.c
+++ b/sys/dev/vt/vt_buf.c
@@ -202,6 +202,36 @@
else
return (test >= begin && test < end);
}
+
+void
+vtbuf_unmark(struct vt_buf *vb)
+{
+
+ vtbuf_set_mark(vb, VTB_MARK_START, 0, 0);
+}
+
+void
+vtbuf_unmark_on_cross(struct vt_buf *vb, int target_begin, int target_end)
+{
+ int hsz, mb, me, tb, te;
+
+ tb = vtbuf_wth(vb, target_begin);
+ te = vtbuf_wth(vb, target_end);
+ mb = vb->vb_mark_start.tp_row;
+ me = vb->vb_mark_end.tp_row;
+ hsz = vb->vb_history_size;
+
+ /*
+ * Test intersection with vtbuf_in_this_range due to use of
+ * the circular buffer.
+ */
+ if (vtbuf_in_this_range(tb, mb, te, hsz) ||
+ vtbuf_in_this_range(tb, me, te, hsz) ||
+ vtbuf_in_this_range(mb, tb, me, hsz) ||
+ vtbuf_in_this_range(mb, te, me, hsz)) {
+ vtbuf_unmark(vb);
+ }
+}
#endif
int
diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c
--- a/sys/dev/vt/vt_core.c
+++ b/sys/dev/vt/vt_core.c
@@ -1197,6 +1197,10 @@
{
struct vt_window *vw = tm->tm_softc;
+#ifndef SC_NO_CUTPASTE
+ vtbuf_unmark_on_cross(&vw->vw_buf, r->tr_begin.tp_row,
+ r->tr_end.tp_row);
+#endif
vtbuf_fill(&vw->vw_buf, r, c);
}
@@ -2465,9 +2469,7 @@
default:
vt_mouse_paste();
/* clear paste buffer selection after paste */
- vtbuf_set_mark(&vw->vw_buf, VTB_MARK_START,
- vd->vd_mx / vf->vf_width,
- vd->vd_my / vf->vf_height);
+ vtbuf_unmark(&vw->vw_buf);
break;
}
return; /* Done */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, May 23, 6:58 AM (11 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33427003
Default Alt Text
D56922.id177683.diff (1 KB)
Attached To
Mode
D56922: Clear cut-paste selection if the area intersects with filled region.
Attached
Detach File
Event Timeline
Log In to Comment