Update
This commit is contained in:
parent
c2b3ea228d
commit
85a039a61e
|
@ -106,7 +106,10 @@ static uint su_timeout = 200; /* Synchronized timeout in millisecon
|
||||||
*
|
*
|
||||||
* 'xdg-open' is the default but this could be set to 'firefox' or 'chrome'.
|
* 'xdg-open' is the default but this could be set to 'firefox' or 'chrome'.
|
||||||
*/
|
*/
|
||||||
static char *url_opener = "xdg-open";
|
static char *url_opener = "xdg-open"; /* Open the URL in this char */
|
||||||
|
|
||||||
|
static int clickeditalic = 1; /* Should clicked links show up as italic (1) or not (0) */
|
||||||
|
static int clickedunderline = 1; /* Should clicked links show up underlined (1) or not (0) */
|
||||||
|
|
||||||
/* Color options */
|
/* Color options */
|
||||||
static const char *colorname[] = {
|
static const char *colorname[] = {
|
||||||
|
@ -194,6 +197,8 @@ static char *understyle = "1"; /* Undercurl style to use */
|
||||||
/* Default column and row options */
|
/* Default column and row options */
|
||||||
static unsigned int cols = 80; /* Number of columns to have by default */
|
static unsigned int cols = 80; /* Number of columns to have by default */
|
||||||
static unsigned int rows = 24; /* Number of rows to have by default */
|
static unsigned int rows = 24; /* Number of rows to have by default */
|
||||||
|
static unsigned int width = 564;
|
||||||
|
static unsigned int height = 364;
|
||||||
|
|
||||||
/* Bell options */
|
/* Bell options */
|
||||||
static int bellvolume = 0; /* Bell volume. It must be a value between -100 and 100. 0 will disable it. */
|
static int bellvolume = 0; /* Bell volume. It must be a value between -100 and 100. 0 will disable it. */
|
||||||
|
|
16
st.c
16
st.c
|
@ -3179,6 +3179,8 @@ openUrlOnClick(int col, int row, char* url_opener)
|
||||||
int col_start = col;
|
int col_start = col;
|
||||||
int row_end = row;
|
int row_end = row;
|
||||||
int col_end = col;
|
int col_end = col;
|
||||||
|
int clickedunderline = clickedunderline;
|
||||||
|
int clickeditalic = clickeditalic;
|
||||||
|
|
||||||
if (term.line[row][col].u == ' ')
|
if (term.line[row][col].u == ' ')
|
||||||
return;
|
return;
|
||||||
|
@ -3226,6 +3228,20 @@ openUrlOnClick(int col, int row, char* url_opener)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i = col_start - strlen(url); i < col_start; i++) {
|
||||||
|
term.line[row_start][i].mode = ATTR_NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Italic clicked links */
|
||||||
|
for (int i = col_start - strlen(url); i < col_start; i++ && clickeditalic) {
|
||||||
|
term.line[row_start][i].mode ^= ATTR_ITALIC;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Underline clicked links */
|
||||||
|
for (int i = col_start - strlen(url); i < col_start; i++ && clickedunderline) {
|
||||||
|
term.line[row_start][i].mode ^= ATTR_UNDERLINE;
|
||||||
|
}
|
||||||
|
|
||||||
char command[strlen(url_opener)+1+strlen(url)];
|
char command[strlen(url_opener)+1+strlen(url)];
|
||||||
sprintf(command, "%s %s", url_opener, url);
|
sprintf(command, "%s %s", url_opener, url);
|
||||||
system(command);
|
system(command);
|
||||||
|
|
Loading…
Reference in a new issue