mirror of
https://github.com/alacritty/alacritty.git
synced 2024-11-11 13:51:01 -05:00
Fix URL scheme highlighting
This commit is contained in:
parent
2c671afb69
commit
679e67d045
1 changed files with 11 additions and 2 deletions
|
@ -130,8 +130,12 @@ impl Urls {
|
|||
},
|
||||
(UrlLocation::Scheme, _) => {
|
||||
if let Some(url) = self.urls.last_mut() {
|
||||
if url.lines[url.lines.len() - 1].color != cell.fg {
|
||||
url.lines.push(RenderLine { start: point, end: point, color: cell.fg });
|
||||
if let Some(last_line) = url.lines.last_mut() {
|
||||
if last_line.color == cell.fg {
|
||||
last_line.end = point;
|
||||
} else {
|
||||
url.lines.push(RenderLine { start: point, end: point, color: cell.fg });
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -173,6 +177,11 @@ impl Urls {
|
|||
}
|
||||
|
||||
fn reset(&mut self) {
|
||||
// Remove temporarily stored scheme URLs
|
||||
if let UrlLocation::Scheme = self.state {
|
||||
self.urls.pop();
|
||||
}
|
||||
|
||||
self.locator = UrlLocator::new();
|
||||
self.state = UrlLocation::Reset;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue