[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Git][debian-mate-team/mate-terminal][master] 2 commits: debian/patches: Add 0001_fix-url-highlighting.patch. Fix URL highlighting...



Title: GitLab

Mike Gabriel pushed to branch master at Debian and Ubuntu MATE Packaging Team / mate-terminal

Commits:

3 changed files:

Changes:

  • debian/changelog
    1
    +mate-terminal (1.24.0-2) unstable; urgency=medium
    
    2
    +
    
    3
    +  * debian/patches:
    
    4
    +    + Add 0001_fix-url-highlighting.patch. Fix URL highlighting broken
    
    5
    +      since vte 0.60. (Closes: #954024). Thanks to Norbert Preining for
    
    6
    +      providing the patch.
    
    7
    +
    
    8
    + -- Mike Gabriel <sunweaver@debian.org>  Tue, 24 Mar 2020 10:58:22 +0100
    
    9
    +
    
    1 10
     mate-terminal (1.24.0-1) unstable; urgency=medium
    
    2 11
     
    
    3 12
       [ Mike Gabriel ]
    

  • debian/patches/0001_fix-url-highlighting.patch
    1
    +From c21a7b374f420b224c24307325061b3bb55aa3bf Mon Sep 17 00:00:00 2001
    
    2
    +From: Norbert Preining <norbert@preining.info>
    
    3
    +Date: Wed, 18 Mar 2020 10:33:55 +0900
    
    4
    +Subject: [PATCH] fix url highlighting due to deprecation of
    
    5
    + vte_terminal_match_add_gregex
    
    6
    +
    
    7
    +---
    
    8
    + src/terminal-screen.c | 41 +++++++++++++++++++++--------------------
    
    9
    + 1 file changed, 21 insertions(+), 20 deletions(-)
    
    10
    +
    
    11
    +diff --git a/src/terminal-screen.c b/src/terminal-screen.c
    
    12
    +index eb6e614d..1ebe9736 100644
    
    13
    +--- a/src/terminal-screen.c
    
    14
    ++++ b/src/terminal-screen.c
    
    15
    +@@ -45,6 +45,9 @@
    
    16
    + 
    
    17
    + #include "eggshell.h"
    
    18
    + 
    
    19
    ++#define PCRE2_CODE_UNIT_WIDTH 0
    
    20
    ++#include <pcre2.h>
    
    21
    ++
    
    22
    + #define URL_MATCH_CURSOR  (GDK_HAND2)
    
    23
    + #define SKEY_MATCH_CURSOR (GDK_HAND2)
    
    24
    + 
    
    25
    +@@ -158,19 +161,19 @@ typedef struct
    
    26
    + {
    
    27
    + 	const char *pattern;
    
    28
    + 	TerminalURLFlavour flavor;
    
    29
    +-	GRegexCompileFlags flags;
    
    30
    ++	guint32 flags;
    
    31
    + } TerminalRegexPattern;
    
    32
    + 
    
    33
    + static const TerminalRegexPattern url_regex_patterns[] =
    
    34
    + {
    
    35
    +-	{ SCHEME "//(?:" USERPASS "\\@)?" HOST PORT URLPATH, FLAVOR_AS_IS, G_REGEX_CASELESS },
    
    36
    +-	{ "(?:www|ftp)" HOSTCHARS_CLASS "*\\." HOST PORT URLPATH , FLAVOR_DEFAULT_TO_HTTP, G_REGEX_CASELESS  },
    
    37
    +-	{ "(?:callto:|h323:|sip:)" USERCHARS_CLASS "[" USERCHARS ".]*(?:" PORT "/[a-z0-9]+)?\\@" HOST, FLAVOR_VOIP_CALL, G_REGEX_CASELESS  },
    
    38
    +-	{ "(?:mailto:)?" USERCHARS_CLASS "[" USERCHARS ".]*\\@" HOSTCHARS_CLASS "+\\." HOST, FLAVOR_EMAIL, G_REGEX_CASELESS  },
    
    39
    +-	{ "news:[[:alnum:]\\Q^_{|}~!\"#$%&'()*+,./;:=?`\\E]+", FLAVOR_AS_IS, G_REGEX_CASELESS  },
    
    40
    ++	{ SCHEME "//(?:" USERPASS "\\@)?" HOST PORT URLPATH, FLAVOR_AS_IS, PCRE2_CASELESS },
    
    41
    ++	{ "(?:www|ftp)" HOSTCHARS_CLASS "*\\." HOST PORT URLPATH , FLAVOR_DEFAULT_TO_HTTP, PCRE2_CASELESS  },
    
    42
    ++	{ "(?:callto:|h323:|sip:)" USERCHARS_CLASS "[" USERCHARS ".]*(?:" PORT "/[a-z0-9]+)?\\@" HOST, FLAVOR_VOIP_CALL, PCRE2_CASELESS  },
    
    43
    ++	{ "(?:mailto:)?" USERCHARS_CLASS "[" USERCHARS ".]*\\@" HOSTCHARS_CLASS "+\\." HOST, FLAVOR_EMAIL, PCRE2_CASELESS  },
    
    44
    ++	{ "news:[[:alnum:]\\Q^_{|}~!\"#$%&'()*+,./;:=?`\\E]+", FLAVOR_AS_IS, PCRE2_CASELESS  },
    
    45
    + };
    
    46
    + 
    
    47
    +-static GRegex **url_regexes;
    
    48
    ++static VteRegex **url_regexes;
    
    49
    + static TerminalURLFlavour *url_regex_flavors;
    
    50
    + static guint n_url_regexes;
    
    51
    + 
    
    52
    +@@ -180,11 +183,11 @@ static void terminal_screen_url_match_remove (TerminalScreen *screen);
    
    53
    + #ifdef ENABLE_SKEY
    
    54
    + static const TerminalRegexPattern skey_regex_patterns[] =
    
    55
    + {
    
    56
    +-	{ "s/key [[:digit:]]* [-[:alnum:]]*",         FLAVOR_AS_IS },
    
    57
    +-	{ "otp-[a-z0-9]* [[:digit:]]* [-[:alnum:]]*", FLAVOR_AS_IS },
    
    58
    ++	{ "s/key [[:digit:]]* [-[:alnum:]]*",         FLAVOR_AS_IS, 0 },
    
    59
    ++	{ "otp-[a-z0-9]* [[:digit:]]* [-[:alnum:]]*", FLAVOR_AS_IS, 0 },
    
    60
    + };
    
    61
    + 
    
    62
    +-static GRegex **skey_regexes;
    
    63
    ++static VteRegex **skey_regexes;
    
    64
    + static guint n_skey_regexes;
    
    65
    + 
    
    66
    + static void  terminal_screen_skey_match_remove (TerminalScreen            *screen);
    
    67
    +@@ -570,16 +573,15 @@ terminal_screen_class_init (TerminalScreenClass *klass)
    
    68
    + 
    
    69
    + 	/* Precompile the regexes */
    
    70
    + 	n_url_regexes = G_N_ELEMENTS (url_regex_patterns);
    
    71
    +-	url_regexes = g_new0 (GRegex*, n_url_regexes);
    
    72
    ++	url_regexes = g_new0 (VteRegex*, n_url_regexes);
    
    73
    + 	url_regex_flavors = g_new0 (TerminalURLFlavour, n_url_regexes);
    
    74
    + 
    
    75
    + 	for (i = 0; i < n_url_regexes; ++i)
    
    76
    + 	{
    
    77
    + 		GError *error = NULL;
    
    78
    + 
    
    79
    +-		url_regexes[i] = g_regex_new (url_regex_patterns[i].pattern,
    
    80
    +-		                              url_regex_patterns[i].flags | G_REGEX_OPTIMIZE | G_REGEX_MULTILINE,
    
    81
    +-		                              0, &error);
    
    82
    ++		url_regexes[i] = vte_regex_new_for_match(url_regex_patterns[i].pattern, -1,
    
    83
    ++				                         url_regex_patterns[i].flags | PCRE2_MULTILINE, &error);
    
    84
    + 		if (error)
    
    85
    + 		{
    
    86
    + 			g_message ("%s", error->message);
    
    87
    +@@ -591,15 +593,14 @@ terminal_screen_class_init (TerminalScreenClass *klass)
    
    88
    + 
    
    89
    + #ifdef ENABLE_SKEY
    
    90
    + 	n_skey_regexes = G_N_ELEMENTS (skey_regex_patterns);
    
    91
    +-	skey_regexes = g_new0 (GRegex*, n_skey_regexes);
    
    92
    ++	skey_regexes = g_new0 (VteRegex*, n_skey_regexes);
    
    93
    + 
    
    94
    + 	for (i = 0; i < n_skey_regexes; ++i)
    
    95
    + 	{
    
    96
    + 		GError *error = NULL;
    
    97
    + 
    
    98
    +-		skey_regexes[i] = g_regex_new (skey_regex_patterns[i].pattern,
    
    99
    +-		                               G_REGEX_OPTIMIZE | G_REGEX_MULTILINE,
    
    100
    +-		                               0, &error);
    
    101
    ++		skey_regexes[i] = vte_regex_new_for_match(skey_regex_patterns[i].pattern, -1,
    
    102
    ++							  PCRE2_MULTILINE, &error);
    
    103
    + 		if (error)
    
    104
    + 		{
    
    105
    + 			g_message ("%s", error->message);
    
    106
    +@@ -1014,7 +1015,7 @@ terminal_screen_profile_notify_cb (TerminalProfile *profile,
    
    107
    + 
    
    108
    + 				tag_data = g_slice_new (TagData);
    
    109
    + 				tag_data->flavor = FLAVOR_SKEY;
    
    110
    +-				tag_data->tag = vte_terminal_match_add_gregex (vte_terminal, skey_regexes[i], 0);
    
    111
    ++				tag_data->tag = vte_terminal_match_add_regex (vte_terminal, skey_regexes[i], 0);
    
    112
    + 				vte_terminal_match_set_cursor_type (vte_terminal, tag_data->tag, SKEY_MATCH_CURSOR);
    
    113
    + 
    
    114
    + 				priv->match_tags = g_slist_prepend (priv->match_tags, tag_data);
    
    115
    +@@ -1059,7 +1060,7 @@ terminal_screen_profile_notify_cb (TerminalProfile *profile,
    
    116
    + 
    
    117
    + 				tag_data = g_slice_new (TagData);
    
    118
    + 				tag_data->flavor = url_regex_flavors[i];
    
    119
    +-				tag_data->tag = vte_terminal_match_add_gregex (vte_terminal, url_regexes[i], 0);
    
    120
    ++				tag_data->tag = vte_terminal_match_add_regex (vte_terminal, url_regexes[i], 0);
    
    121
    + 				vte_terminal_match_set_cursor_type (vte_terminal, tag_data->tag, URL_MATCH_CURSOR);
    
    122
    + 
    
    123
    + 				priv->match_tags = g_slist_prepend (priv->match_tags, tag_data);
    
    124
    +

  • debian/patches/series
    1
    +0001_fix-url-highlighting.patch


  • Reply to: