summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2023-01-21 22:20:26 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2023-01-21 22:20:26 +0900
commitb077f6821d4f27ac9e4f1acd4619139ba4a14d14 (patch)
tree3ad94bfb56d3d144f65f3423630524fe06395022
parenta79de11af78d98f3f1931870d2866012cc6e962a (diff)
Action argument in enclosed form should allow new lines
Close #3138
-rw-r--r--CHANGELOG.md4
-rw-r--r--src/options.go2
-rw-r--r--src/options_test.go2
3 files changed, 6 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4ca63072..e1993845 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,10 @@
CHANGELOG
=========
+0.36.1
+------
+- Bug fixes and improvements
+
0.36.0
------
- Added `--listen=HTTP_PORT` option to start HTTP server. It allows external
diff --git a/src/options.go b/src/options.go
index fd160367..39b1b0e1 100644
--- a/src/options.go
+++ b/src/options.go
@@ -954,7 +954,7 @@ Loop:
ce = regexp.QuoteMeta(ce)
// @$ or @+
- loc = regexp.MustCompile(fmt.Sprintf(`^%s.*?(%s[+,]|%s$)`, cs, ce, ce)).FindStringIndex(action)
+ loc = regexp.MustCompile(fmt.Sprintf(`(?s)^%s.*?(%s[+,]|%s$)`, cs, ce, ce)).FindStringIndex(action)
if loc == nil {
masked += action
break
diff --git a/src/options_test.go b/src/options_test.go
index 8754716c..4e300db7 100644
--- a/src/options_test.go
+++ b/src/options_test.go
@@ -268,7 +268,7 @@ func TestBind(t *testing.T) {
}
parseKeymap(keymap,
"ctrl-a:kill-line,ctrl-b:toggle-sort+up+down,c:page-up,alt-z:page-down,"+
- "f1:execute(ls {+})+abort+execute(echo {+})+select-all,f2:execute/echo {}, {}, {}/,f3:execute[echo '({})'],f4:execute;less {};,"+
+ "f1:execute(ls {+})+abort+execute(echo \n{+})+select-all,f2:execute/echo {}, {}, {}/,f3:execute[echo '({})'],f4:execute;less {};,"+
"alt-a:execute-Multi@echo (,),[,],/,:,;,%,{}@,alt-b:execute;echo (,),[,],/,:,@,%,{};,"+
"x:Execute(foo+bar),X:execute/bar+baz/"+
",f1:+first,f1:+top"+