Skip to content

Commit

Permalink
fixed "syntax"
Browse files Browse the repository at this point in the history
  • Loading branch information
pgilfernandez committed Feb 23, 2022
1 parent d8ceb66 commit 1598b1c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions lib/config-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"type": "object",
"title": "General",
"properties": {
"splitSintax": {
"splitSyntax": {
"type": "string",
"title": "Split sintax",
"title": "Split syntax",
"default": " => ",
"description": "The sintax used to split each line between the FIND and REPLACE statements",
"description": "The syntax used to split each line between the FIND and REPLACE statements",
"order": 1
},
"matchCase": {
Expand Down
10 changes: 5 additions & 5 deletions lib/multiple-find-replace.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default {
find(editor) {
finishWithError = false
// Define defaultText variable after package settings declaration
var defaultText = 'Find and replace me' + atom.config.get('multiple-find-replace.general.splitSintax') + 'Replaced!';
var defaultText = 'Find and replace me' + atom.config.get('multiple-find-replace.general.splitSyntax') + 'Replaced!';
fileExists = fs.existsSync(path)
if (fileExists) {
atom.workspace.open(path)
Expand Down Expand Up @@ -93,7 +93,7 @@ export default {
doreplacement(text) {
finishWithError = false
// Define defaultText variable after package settings declaration
var defaultText = 'Find and replace me' + atom.config.get('multiple-find-replace.general.splitSintax') + 'Replaced!';
var defaultText = 'Find and replace me' + atom.config.get('multiple-find-replace.general.splitSyntax') + 'Replaced!';
// Asynchronous read
fs.readFile(path, function (err, data) {
if (err) {
Expand Down Expand Up @@ -121,8 +121,8 @@ export default {
lines = fullText.split(/\r?\n/g) // it works both for LF line endings and CRLF
linesQuantity = lines.length - 1
for (var i = 0; i < linesQuantity; i++) {
if (lines[i].includes(atom.config.get('multiple-find-replace.general.splitSintax'))) {
line = lines[i].split(atom.config.get('multiple-find-replace.general.splitSintax'))
if (lines[i].includes(atom.config.get('multiple-find-replace.general.splitSyntax'))) {
line = lines[i].split(atom.config.get('multiple-find-replace.general.splitSyntax'))
line[0]
line[1]
if ((atom.config.get('multiple-find-replace.general.matchCase')) && (atom.config.get('multiple-find-replace.general.wholeWord'))) {
Expand All @@ -140,7 +140,7 @@ export default {
text = text.replace(findRegExp, line[1].toString());
l = i+1
} else {
atom.notifications.addError('Multiple Find and Replace', {detail: 'The template has a line without the correct FIND and REPLACE splitter sintax, please check it out.'})
atom.notifications.addError('Multiple Find and Replace', {detail: 'The template has a line without the correct FIND and REPLACE splitter syntax, please check it out.'})
atom.workspace.open(path)
finishWithError = true
break;
Expand Down

0 comments on commit 1598b1c

Please sign in to comment.