From 6d266984a4729f09eda42027d6781d26eb198d25 Mon Sep 17 00:00:00 2001 From: MarcoPolo-PasTonMolo Date: Mon, 13 Feb 2023 23:40:58 +0200 Subject: Fix quote and url autocompletion for MAM and history After adding MAM quote and url autocompletion wouldn't pick up messages from MAM or history(from DB) or would have them in the wrong order. This commit fixes that. Fixes https://github.com/profanity-im/profanity/issues/1770 --- src/tools/autocomplete.c | 9 +++++++-- src/tools/autocomplete.h | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src/tools') diff --git a/src/tools/autocomplete.c b/src/tools/autocomplete.c index 2f1acc1f..461c2b40 100644 --- a/src/tools/autocomplete.c +++ b/src/tools/autocomplete.c @@ -141,7 +141,7 @@ autocomplete_update(Autocomplete ac, char** items) } void -autocomplete_add_reverse(Autocomplete ac, const char* item) +autocomplete_add_unsorted(Autocomplete ac, const char* item, const gboolean is_reversed) { if (ac) { char* item_cpy; @@ -153,7 +153,12 @@ autocomplete_add_reverse(Autocomplete ac, const char* item) } item_cpy = strdup(item); - ac->items = g_list_prepend(ac->items, item_cpy); + + if (is_reversed) { + ac->items = g_list_prepend(ac->items, item_cpy); + } else { + ac->items = g_list_append(ac->items, item_cpy); + } } } diff --git a/src/tools/autocomplete.h b/src/tools/autocomplete.h index 697a551f..851dbc0d 100644 --- a/src/tools/autocomplete.h +++ b/src/tools/autocomplete.h @@ -55,7 +55,7 @@ void autocomplete_add_all(Autocomplete ac, char** items); void autocomplete_update(Autocomplete ac, char** items); void autocomplete_remove(Autocomplete ac, const char* const item); void autocomplete_remove_all(Autocomplete ac, char** items); -void autocomplete_add_reverse(Autocomplete ac, const char* item); +void autocomplete_add_unsorted(Autocomplete ac, const char* item, const gboolean is_reversed); // find the next item prefixed with search string gchar* autocomplete_complete(Autocomplete ac, const gchar* search_str, gboolean quote, gboolean previous); -- cgit 1.4.1-2-gfad0
path: root/ranger/fsobject/file.py
blob: 5458b8b11177108ac6ecba5bd2f08250596c200c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115