summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2015-09-20 15:42:28 +0200
committerBoris Faure <billiob@gmail.com>2015-09-20 15:55:24 +0200
commit01ff1e1d8ad61ae7a0a9ac90064bb3a07702d978 (patch)
treeafa06569af0ad439266f8efb11832354c3c5b502
parentcd6f66003ac46e2970c5558188c6792faea88b0d (diff)
do not right trim "." on word selection
this makes double click on "../foobar"
-rw-r--r--src/bin/termio.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/bin/termio.c b/src/bin/termio.c
index 4357e42..3c09219 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -2802,7 +2802,7 @@ _codepoint_is_wordsep(const Eina_Unicode g)
2802} 2802}
2803 2803
2804static Eina_Bool 2804static Eina_Bool
2805_to_trim(Eina_Unicode codepoint) 2805_to_trim(Eina_Unicode codepoint, Eina_Bool right_trim)
2806{ 2806{
2807 static const Eina_Unicode trim_chars[] = 2807 static const Eina_Unicode trim_chars[] =
2808 { 2808 {
@@ -2813,6 +2813,8 @@ _to_trim(Eina_Unicode codepoint)
2813 }; 2813 };
2814 size_t i = 0, len; 2814 size_t i = 0, len;
2815 len = sizeof(trim_chars)/sizeof((trim_chars)[0]); 2815 len = sizeof(trim_chars)/sizeof((trim_chars)[0]);
2816 if (right_trim)
2817 len--; /* do not right trim . */
2816 2818
2817 for (i = 0; i < len; i++) 2819 for (i = 0; i < len; i++)
2818 if (codepoint == trim_chars[i]) 2820 if (codepoint == trim_chars[i])
@@ -2836,7 +2838,7 @@ _trim_sel_word(Termio *sd)
2836 { 2838 {
2837 cells = termpty_cellrow_get(pty, y, &w); 2839 cells = termpty_cellrow_get(pty, y, &w);
2838 2840
2839 while (start < w && _to_trim(cells[start].codepoint)) 2841 while (start < w && _to_trim(cells[start].codepoint, EINA_TRUE))
2840 start++; 2842 start++;
2841 2843
2842 if (start < w) 2844 if (start < w)
@@ -2864,7 +2866,7 @@ _trim_sel_word(Termio *sd)
2864 { 2866 {
2865 cells = termpty_cellrow_get(pty, y, &w); 2867 cells = termpty_cellrow_get(pty, y, &w);
2866 2868
2867 while (end >= 0 && _to_trim(cells[end].codepoint)) 2869 while (end >= 0 && _to_trim(cells[end].codepoint, EINA_FALSE))
2868 end--; 2870 end--;
2869 2871
2870 if (end >= 0) 2872 if (end >= 0)