do not right trim "." on word selection

this makes double click on "../foobar"
This commit is contained in:
Boris Faure 2015-09-20 15:42:28 +02:00
parent 9c4167f74f
commit 4c53f10bf0
1 changed files with 5 additions and 3 deletions

View File

@ -2796,7 +2796,7 @@ _codepoint_is_wordsep(const Eina_Unicode g)
}
static Eina_Bool
_to_trim(Eina_Unicode codepoint)
_to_trim(Eina_Unicode codepoint, Eina_Bool right_trim)
{
static const Eina_Unicode trim_chars[] =
{
@ -2807,6 +2807,8 @@ _to_trim(Eina_Unicode codepoint)
};
size_t i = 0, len;
len = sizeof(trim_chars)/sizeof((trim_chars)[0]);
if (right_trim)
len--; /* do not right trim . */
for (i = 0; i < len; i++)
if (codepoint == trim_chars[i])
@ -2830,7 +2832,7 @@ _trim_sel_word(Termio *sd)
{
cells = termpty_cellrow_get(pty, y, &w);
while (start < w && _to_trim(cells[start].codepoint))
while (start < w && _to_trim(cells[start].codepoint, EINA_TRUE))
start++;
if (start < w)
@ -2858,7 +2860,7 @@ _trim_sel_word(Termio *sd)
{
cells = termpty_cellrow_get(pty, y, &w);
while (end >= 0 && _to_trim(cells[end].codepoint))
while (end >= 0 && _to_trim(cells[end].codepoint, EINA_FALSE))
end--;
if (end >= 0)