Skip to content

Commit 7e04226

Browse files
committed
0.0.3 various fixes and changes
1 parent 5ffcfc6 commit 7e04226

File tree

4 files changed

+53
-38
lines changed

4 files changed

+53
-38
lines changed

CHANGELOG.md

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,44 @@
22

33
All notable changes to the "PasteRegEx" extension will be documented in this file.
44

5-
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
5+
- Added - for new features.
6+
- Changed - for changes in existing functionality.
7+
- Deprecated - for soon-to-be removed features.
8+
- Removed - for now removed features.
9+
- Fixed - for any bug fixes.
10+
- Security - in case of vulnerabilities.
611

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

9-
- Initial release
14+
## 0.0.3 - 2020-04-29
15+
16+
Patch
17+
18+
- Added
19+
- added a testingStrings.txt file for testing all of the commands
20+
- Changed
21+
- I changed the regular expressions for a couple of the commands to make them account for more situations
22+
- Fixed
23+
- fixed the issue of not implementing the RegEx statement correctly
24+
25+
## 0.0.2 - 2020-04-29
26+
27+
Patch
28+
29+
- Changed
30+
- one regex statement in extension.ts to match the others
31+
- this does not change the command's function at all
32+
- minor changes to the README
33+
- added known bug
34+
35+
## 0.0.1 - 2020-04-26
36+
37+
Initial release of PasteRegEx
38+
39+
- Added <!-- for new features. -->
40+
- apply regular expression to selected text
41+
- implemented the following commands
42+
- rmHangingSpaces
43+
- rmNewLines
44+
- rmHyphenLineEnd
45+
- rmSentenceBreaks

README.md

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
PasteRegEx is a simple extension which applies Regular Expressions (RegEx) to text selected in an active editor.
44

5-
-----------------------------------------------------------------------------------------------------------
6-
75
## Features
86

97
After you select some text in an editor you can then select a PasteRegEx command and it will apply the Regular Expression to that selected text.
@@ -27,8 +25,6 @@ functionName - function description - "regular expression", "flags" - "replaceme
2725
> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow.
2826
-->
2927

30-
-----------------------------------------------------------------------------------------------------------
31-
3228
## Requirements
3329

3430
I do not believe there are any special requirements needed to run this extension.
@@ -45,7 +41,6 @@ This extension contributes the following settings:
4541
* `myExtension.enable`: enable/disable this extension
4642
* `myExtension.thing`: set to `blah` to do something
4743
-->
48-
-----------------------------------------------------------------------------------------------------------
4944

5045
## Plans for Future Releases
5146

@@ -69,35 +64,12 @@ These plans are very much a wishlist that may or may not ever be completed. Feel
6964
- I'm not sure I want this or not so I'll give it some more thought
7065
- testing (I have NO experience with software testing so this will almost certainly happen ONLY if someone else takes on the task)
7166

72-
-----------------------------------------------------------------------------------------------------------
73-
7467
## Known Issues
7568

7669
<!-- At the moment there are no known issues -->
7770
- for some reason the regex is not completing as expected
78-
<!-- - this might be an issue with the string String difference as it was working before I changed it -->
79-
80-
-----------------------------------------------------------------------------------------------------------
71+
- this might be an issue with the string String difference as it was working before I changed it
8172

8273
## Release Notes
8374

84-
### 0.0.1
85-
86-
- updated
87-
- minor changes to the README
88-
- one regex statement in extension.ts to match the others
89-
- added known bug
90-
- changed the release versioning
91-
92-
### 0.0.1
93-
94-
Initial release of PasteRegEx
95-
96-
Includes:
97-
98-
- apply regular expression to selected text
99-
- implemented the following commands
100-
- rmHangingSpaces
101-
- rmNewLines
102-
- rmHyphenLineEnd
103-
- rmSentenceBreaks
75+
[see the changelog](CHANGELOG.md)

src/extension.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export function activate(context: vscode.ExtensionContext) {
3737
*/
3838
var selectionText: String = getSelectedText();
3939
let editor = vscode.window.activeTextEditor;
40-
let RegEx = new RegExp(" $", "gm")
40+
const RegEx = new RegExp(" +$", "gm")
4141
var modifiedString: string = selectionText.replace(RegEx, "");
4242
insertNewString(modifiedString)
4343
});
@@ -48,8 +48,8 @@ export function activate(context: vscode.ExtensionContext) {
4848
*/
4949
var selectionText: String = getSelectedText();
5050
let editor = vscode.window.activeTextEditor;
51-
let RegEx = new RegExp("\n", "gm")
52-
var modifiedString: string = selectionText.replace("/\n/gm", " ");
51+
const RegEx = new RegExp("\r?|\n?", "gm")
52+
var modifiedString: string = selectionText.replace(RegEx, " ");
5353
insertNewString(modifiedString)
5454
});
5555

@@ -59,7 +59,7 @@ export function activate(context: vscode.ExtensionContext) {
5959
*/
6060
var selectionText: String = getSelectedText();
6161
let editor = vscode.window.activeTextEditor;
62-
let RegEx = new RegExp("(?<=[a-z])-$\n(?=[a-z])", "gm")
62+
const RegEx = new RegExp("(?<=[a-z])-$\r?|\n?(?=[a-z])", "gm")
6363
var modifiedString: string = selectionText.replace(RegEx, "");
6464
insertNewString(modifiedString)
6565
});
@@ -70,7 +70,7 @@ export function activate(context: vscode.ExtensionContext) {
7070
*/
7171
var selectionText: String = getSelectedText();
7272
let editor = vscode.window.activeTextEditor;
73-
let RegEx = new RegExp("[a-z]$\n+[a-z]", "gm")
73+
const RegEx = new RegExp("(?<=[a-z])$\r?|\n?(?=[a-z])", "gm")
7474
var modifiedString: string = selectionText.replace(RegEx, " ");
7575
insertNewString(modifiedString)
7676
});

testingStrings.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
This sentence is split in the middle
2+
to test the sentence breaks command.
3+
4+
This sentence is here to test the the hanging spaces command. Here the command should remove multiple hanging spaces.
5+
6+
This sentence is to test the hy-
7+
phen work break command.

0 commit comments

Comments
 (0)