Skip to content
Myr

Fix `.` to match newlines as well (#265)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent fa5b589 · Browse files · 2 files+3 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+3 added−3 removed

  • other:+3 added−3 removed

2 files+3 added−3 removed

modified:src/options_test.go+2 added-2 removed
162 unmodified lines
163 parseKeymap(keymap, execmap, false,164 "ctrl-a:kill-line,ctrl-b:toggle-sort,c:page-up,alt-z:page-down,"+165 "f1:execute(ls {}),f2:execute/echo {}, {}, {}/,f3:execute[echo '({})'],f4:execute:less {}:,"+166 "alt-a:execute@echo (,),[,],/,:,;,%,{}@,alt-b:execute;echo (,),[,],/,:,@,%,{};"+167 ",X:execute=foobar,Y:execute(baz)")167 ",X:execute=\nfoobar,Y:execute(baz)")168 if !toggleSort {169 t.Errorf("toggleSort not set")170 }171 check(actKillLine, keymap[curses.CtrlA])
9 unmodified lines
181 checkString("echo '({})'", execmap[curses.F3])182 checkString("less {}", execmap[curses.F4])183 checkString("echo (,),[,],/,:,;,%,{}", execmap[curses.AltA])184 checkString("echo (,),[,],/,:,@,%,{}", execmap[curses.AltB])185 checkString("foobar,Y:execute(baz)", execmap[curses.AltZ+'X'])185 checkString("\nfoobar,Y:execute(baz)", execmap[curses.AltZ+'X'])186187 for idx, char := range []rune{'~', '!', '@', '#', '$', '%', '^', '&', '*', '|', ':', ';', '/'} {188 keymap, execmap, toggleSort =189 parseKeymap(keymap, execmap, false, fmt.Sprintf("%d:execute%cfoobar%c", idx%10, char, char))
55 unmodified lines
modified:src/options.go+1 added-1 removed
410 unmodified lines
411 if executeRegexp == nil {412 // Backreferences are not supported.413 // "~!@#$%^&*:;/|".each_char.map { |c| Regexp.escape(c) }.map { |c| "#{c}[^#{c}]*#{c}" }.join('|')414 executeRegexp = regexp.MustCompile(415 ":execute=.*|:execute(\\([^)]*\\)|\\[[^\\]]*\\]|~[^~]*~|![^!]*!|@[^@]*@|\\#[^\\#]*\\#|\\$[^\\$]*\\$|%[^%]*%|\\^[^\\^]*\\^|&[^&]*&|\\*[^\\*]*\\*|:[^:]*:|;[^;]*;|/[^/]*/|\\|[^\\|]*\\|)")415 "(?s):execute=.*|:execute(\\([^)]*\\)|\\[[^\\]]*\\]|~[^~]*~|![^!]*!|@[^@]*@|\\#[^\\#]*\\#|\\$[^\\$]*\\$|%[^%]*%|\\^[^\\^]*\\^|&[^&]*&|\\*[^\\*]*\\*|:[^:]*:|;[^;]*;|/[^/]*/|\\|[^\\|]*\\|)")416 }417 masked := executeRegexp.ReplaceAllStringFunc(str, func(src string) string {418 return ":execute(" + strings.Repeat(" ", len(src)-10) + ")"419 })
332 unmodified lines