summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-07-03 12:57:32 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-07-03 12:57:32 +0000
commit9b476039cf9d6cc1ccdc7b6fb0fbbf3c8b4becae (patch)
tree6632f8c8133b01907c8f435274bf77ba6d309904 /src/bin
parent77650afb6c3c4395aa2f19dbd640eb34c283c196 (diff)
fix grid->text conversion to handle some space cornercases better.
SVN revision: 73236
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/termio.c43
1 files changed, 40 insertions, 3 deletions
diff --git a/src/bin/termio.c b/src/bin/termio.c
index 3613e58..4633e2d 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -1352,7 +1352,7 @@ _smart_add(Evas_Object *obj)
1352{ 1352{
1353 Termio *sd; 1353 Termio *sd;
1354 Evas_Object_Smart_Clipped_Data *cd; 1354 Evas_Object_Smart_Clipped_Data *cd;
1355 Evas_Object *o, *g; 1355 Evas_Object *o;
1356 int i, j, k, l, n; 1356 int i, j, k, l, n;
1357 1357
1358 _parent_sc.add(obj); 1358 _parent_sc.add(obj);
@@ -1815,7 +1815,7 @@ termio_selection_get(Evas_Object *obj, int c1x, int c1y, int c2x, int c2y)
1815 else break; 1815 else break;
1816 } 1816 }
1817 if (x >= w) break; 1817 if (x >= w) break;
1818 if ((cells[x].codepoint == 0) || (cells[x].codepoint == ' ')) 1818 if ((cells[x].codepoint == 0) || (cells[x].codepoint == ' '))
1819 { 1819 {
1820 if (last0 < 0) last0 = x; 1820 if (last0 < 0) last0 = x;
1821 } 1821 }
@@ -1858,7 +1858,44 @@ termio_selection_get(Evas_Object *obj, int c1x, int c1y, int c2x, int c2y)
1858 } 1858 }
1859 if (last0 >= 0) 1859 if (last0 >= 0)
1860 { 1860 {
1861 eina_strbuf_append_char(sb, '\n'); 1861 if (y == c2y)
1862 {
1863 Eina_Bool have_more = EINA_FALSE;
1864
1865 for (x = end_x + 1; x < w; x++)
1866 {
1867 if ((cells[x].codepoint == 0) &&
1868 (cells[x].att.dblwidth))
1869 {
1870 if (x < (w - 1)) x++;
1871 else break;
1872 }
1873 if (((cells[x].codepoint != 0) &&
1874 (cells[x].codepoint != ' ')) ||
1875 (cells[x].att.newline) ||
1876 (cells[x].att.tab))
1877 {
1878 have_more = EINA_TRUE;
1879 break;
1880 }
1881 }
1882 if (!have_more) eina_strbuf_append_char(sb, '\n');
1883 else
1884 {
1885 for (x = last0; x <= end_x; x++)
1886 {
1887 if ((cells[x].codepoint == 0) &&
1888 (cells[x].att.dblwidth))
1889 {
1890 if (x < (w - 1)) x++;
1891 else break;
1892 }
1893 if (x >= w) break;
1894 eina_strbuf_append_char(sb, ' ');
1895 }
1896 }
1897 }
1898 else eina_strbuf_append_char(sb, '\n');
1862 } 1899 }
1863 } 1900 }
1864 1901