summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/constants.go2
-rw-r--r--src/options.go10
2 files changed, 11 insertions, 1 deletions
diff --git a/src/constants.go b/src/constants.go
index 8be40eda..c60c9582 100644
--- a/src/constants.go
+++ b/src/constants.go
@@ -38,7 +38,7 @@ const (
defaultHistoryMax int = 1000
// Jump labels
- defaultJumpLabels string = "qwertyuiopasdfghjklzxcvbnm1234567890QWERTYUIOPASDFGHJKLZXCVBNM,<.>/?!@#$%^&*<>/?()[{]}"
+ defaultJumpLabels string = "asdfghjklqwertyuiopzxcvbnm1234567890ASDFGHJKLQWERTYUIOPZXCVBNM`~;:,<.>/?'\"!@#$%^&*()[{]}-_=+"
)
// fzf events
diff --git a/src/options.go b/src/options.go
index 10a22287..ffd57e96 100644
--- a/src/options.go
+++ b/src/options.go
@@ -724,6 +724,7 @@ func parseOptions(opts *Options, allArgs []string) {
opts.History.maxSize = historyMax
}
}
+ validateJumpLabels := false
for i := 0; i < len(allArgs); i++ {
arg := allArgs[i]
switch arg {
@@ -817,6 +818,7 @@ func parseOptions(opts *Options, allArgs []string) {
opts.InlineInfo = false
case "--jump-labels":
opts.JumpLabels = nextString(allArgs, &i, "label characters required")
+ validateJumpLabels = true
case "-1", "--select-1":
opts.Select1 = true
case "+1", "--no-select-1":
@@ -927,6 +929,14 @@ func parseOptions(opts *Options, allArgs []string) {
if len(opts.JumpLabels) == 0 {
errorExit("empty jump labels")
}
+
+ if validateJumpLabels {
+ for _, r := range opts.JumpLabels {
+ if r < 32 || r > 126 {
+ errorExit("non-ascii jump labels are not allowed")
+ }
+ }
+ }
}
func postProcessOptions(opts *Options) {