mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-24 13:45:00 +00:00
refactor: commit sha link in message (#382)
* remove the built-in commit issue tracker rule * hyperlink in commit message now supports commit sha
This commit is contained in:
parent
6485a6f93a
commit
191763e1d8
11 changed files with 113 additions and 90 deletions
31
src/Models/Hyperlink.cs
Normal file
31
src/Models/Hyperlink.cs
Normal file
|
@ -0,0 +1,31 @@
|
|||
using Avalonia.Controls.Documents;
|
||||
|
||||
namespace SourceGit.Models
|
||||
{
|
||||
public class Hyperlink
|
||||
{
|
||||
public int Start { get; set; } = 0;
|
||||
public int Length { get; set; } = 0;
|
||||
public string Link { get; set; } = "";
|
||||
public bool IsCommitSHA { get; set; } = false;
|
||||
|
||||
public Hyperlink(int start, int length, string link, bool isCommitSHA = false)
|
||||
{
|
||||
Start = start;
|
||||
Length = length;
|
||||
Link = link;
|
||||
IsCommitSHA = isCommitSHA;
|
||||
}
|
||||
|
||||
public bool Intersect(int start, int length)
|
||||
{
|
||||
if (start == Start)
|
||||
return true;
|
||||
|
||||
if (start < Start)
|
||||
return start + length > Start;
|
||||
|
||||
return start < Start + Length;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue