elm_code: Selections of word break on quotes too
authorAndy Williams <andy@andywilliams.me>
Tue, 10 Jan 2017 12:53:21 +0000 (12:53 +0000)
committerAndy Williams <andy@andywilliams.me>
Tue, 10 Jan 2017 12:53:21 +0000 (12:53 +0000)
src/lib/elementary/elm_code_widget_selection.c
src/tests/elementary/elm_code_test_widget_selection.c

index f9b75a7..9c73bdc 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "elm_code_widget_private.h"
 
-static char _breaking_chars[] = " \t,.?!;:*&()[]{}";
+static char _breaking_chars[] = " \t,.?!;:*&()[]{}'\"";
 
 static Elm_Code_Widget_Selection_Data *
 _elm_code_widget_selection_new()
index 562a106..e394300 100644 (file)
@@ -524,6 +524,7 @@ START_TEST (elm_code_test_widget_selection_select_word)
    file = elm_code_file_new(code);
    elm_code_file_line_append(file, "word selection test", 19, NULL);
    elm_code_file_line_append(file, "more stuff\tto test", 18, NULL);
+   elm_code_file_line_append(file, "word \"symbols\" test", 19, NULL);
 
    win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
    widget = elm_code_widget_add(win, code);
@@ -542,6 +543,11 @@ START_TEST (elm_code_test_widget_selection_select_word)
    selection = elm_code_widget_selection_text_get(widget);
    ck_assert_str_eq("stuff", selection);
    free(selection);
+
+   elm_code_widget_selection_select_word(widget, 3, 9);
+   selection = elm_code_widget_selection_text_get(widget);
+   ck_assert_str_eq("symbols", selection);
+   free(selection);
    elm_shutdown();
 }
 END_TEST