summaryrefslogtreecommitdiff
path: root/internal/lcontext
diff options
context:
space:
mode:
Diffstat (limited to 'internal/lcontext')
-rw-r--r--internal/lcontext/lcontext.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/internal/lcontext/lcontext.go b/internal/lcontext/lcontext.go
index bd51d94..89cb7c3 100644
--- a/internal/lcontext/lcontext.go
+++ b/internal/lcontext/lcontext.go
@@ -6,3 +6,17 @@ type LContext struct {
BeforeContext int
MaxCount int
}
+
+// Has returns true if it has any parameter set.
+func (c LContext) Has() bool {
+ if c.AfterContext > 0 {
+ return true
+ }
+ if c.BeforeContext > 0 {
+ return true
+ }
+ if c.MaxCount > 0 {
+ return true
+ }
+ return false
+}