Skip to content

Commit

Permalink
0.0.4
Browse files Browse the repository at this point in the history
0.0.4 - 2020-05-02

Patch

- Changed
    - changed all of the regular expressions and placed them directly into the string replace `searchValue` section
- Fixed
    - fixed the issue of the rmNewLines working correctly
    - fixed the issue of the rmSentenceBreaks working correctly
  • Loading branch information
ldsands committed May 2, 2020
1 parent 1caa308 commit 21a0c48
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 8 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ All notable changes to the "PasteRegEx" extension will be documented in this fil

<!-- Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. -->

## 0.0.4 - 2020-05-02

Patch

- Changed
- changed all of the regular expressions and placed them directly into the string replace `searchValue` section
- Fixed
- fixed the issue of the rmNewLines working correctly
- fixed the issue of the rmSentenceBreaks working correctly

## 0.0.3 - 2020-04-29

Patch
Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,23 @@ These plans are very much a wishlist that may or may not ever be completed. Feel
## Release Notes

[see the changelog](CHANGELOG.md)

<!--
## Publishing Instructions
```PowerShell
# if you have not yet setup vsce then enter the following code
npm install -g vsce
vsce login (publisher name)
# to publish a patch (increment the version number automatically)
vsce publish patch -p $token
# to publish a minor (increment the version number automatically)
vsce publish minor -p $token
# to publish a major (increment the version number automatically)
vsce publish major -p $token
# to unpublish an extension
vsce unpublish (publisher name).(extension name)
```
-->
12 changes: 4 additions & 8 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ export function activate(context: vscode.ExtensionContext) {
*/
var selectionText: String = getSelectedText();
let editor = vscode.window.activeTextEditor;
const RegEx = new RegExp(" +$", "gm")
var modifiedString: string = selectionText.replace(RegEx, "");
var modifiedString: string = selectionText.replace(/ +$/gm, "");
insertNewString(modifiedString)
});

Expand All @@ -48,8 +47,7 @@ export function activate(context: vscode.ExtensionContext) {
*/
var selectionText: String = getSelectedText();
let editor = vscode.window.activeTextEditor;
const RegEx = new RegExp("\r?|\n?", "gm")
var modifiedString: string = selectionText.replace(RegEx, " ");
var modifiedString: string = selectionText.replace(/\r\n+|\n+|\r+/gm, " ");
insertNewString(modifiedString)
});

Expand All @@ -59,8 +57,7 @@ export function activate(context: vscode.ExtensionContext) {
*/
var selectionText: String = getSelectedText();
let editor = vscode.window.activeTextEditor;
const RegEx = new RegExp("(?<=[a-z])-$\r?|\n?(?=[a-z])", "gm")
var modifiedString: string = selectionText.replace(RegEx, "");
var modifiedString: string = selectionText.replace(/(?<=[a-z])-$\r\n+|\n+|\r+(?=[a-z])/gm, "");
insertNewString(modifiedString)
});

Expand All @@ -70,8 +67,7 @@ export function activate(context: vscode.ExtensionContext) {
*/
var selectionText: String = getSelectedText();
let editor = vscode.window.activeTextEditor;
const RegEx = new RegExp("(?<=[a-z])$\r?|\n?(?=[a-z])", "gm")
var modifiedString: string = selectionText.replace(RegEx, " ");
var modifiedString: string = selectionText.replace(/([a-z])(\r\n+|\n+|\r+)(?=[a-z])/gm, "$1 ");
insertNewString(modifiedString)
});
}
Expand Down

0 comments on commit 21a0c48

Please sign in to comment.