Skip to content

Commit

Permalink
Merge pull request #2856 from xconverge/allow-dot-in-surround-tags
Browse files Browse the repository at this point in the history
fixes #2850
  • Loading branch information
xconverge authored Jul 19, 2018
2 parents f29b8ba + 23181e6 commit 4515336
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/actions/plugins/surround.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ export class CommandSurroundAddToReplacement extends BaseCommand {
let endReplace = replacement;

if (startReplace[0] === '<') {
let tagName = /([-\w]+)/.exec(startReplace);
let tagName = /([-\w.]+)/.exec(startReplace);
if (tagName) {
endReplace = `</${tagName[1]}>`;
} else {
Expand Down
7 changes: 7 additions & 0 deletions test/plugins/surround.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ suite('surround plugin', () => {
end: ['first <abc attr1 attr2="test">|line</abc> test'],
});

newTest({
title: "'cst<' surrounds word with tags that have a dot in them",
start: ['first <test>li|ne</test> test'],
keysPressed: 'cst<abc.def>',
end: ['first <abc.def>li|ne</abc.def> test'],
});

newTest({
title: "'yss)' surrounds entire line respecting whitespace",
start: ['foo', ' foob|ar '],
Expand Down

0 comments on commit 4515336

Please sign in to comment.