[vte/wip/egmont/bidi: 70/107] fix block selection at cjks
- From: Egmont Koblinger <egmontkob src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte/wip/egmont/bidi: 70/107] fix block selection at cjks
- Date: Thu, 30 May 2019 21:28:34 +0000 (UTC)
commit 7778fb9cbd761ee6ca69d75227c16091d34ba7d8
Author: Egmont Koblinger <egmont gmail com>
Date: Mon Sep 24 13:34:57 2018 +0200
fix block selection at cjks
src/vte.cc | 5 +++++
1 file changed, 5 insertions(+)
---
diff --git a/src/vte.cc b/src/vte.cc
index 571c0668..408ca7b9 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -5531,12 +5531,17 @@ Terminal::cell_is_selected_vis(vte::grid::column_t col,
{
if (m_selection_block_mode) {
/* In block mode, make sure CJKs and TABs aren't cut in half. */
+ /* BiDi: convert to logical column... */
+ vte::base::BidiRow const* bidirow = m_ringview.get_row_map(row);
+ col = bidirow->vis2log(col);
while (col > 0) {
VteCell const* cell = find_charcell(col, row);
if (!cell || !cell->attr.fragment())
break;
col--;
}
+ /* ... and back to visual. */
+ col = bidirow->log2vis(col);
return m_selection_resolved.box_contains ({ row, col });
} else {
/* BiDi: convert to logical column. */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]