Skip to content

Commit

Permalink
Merge branch 'feature/List-Button'
Browse files Browse the repository at this point in the history
  • Loading branch information
daddel80 committed Oct 17, 2024
2 parents aaa75b4 + 9515157 commit 1ff3bee
Show file tree
Hide file tree
Showing 18 changed files with 2,148 additions and 592 deletions.
Binary file modified MultiReplace.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MultiReplace for Notepad++
[![License: GPL-2.0](https://img.shields.io/badge/license-GPL--2.0-brightgreen)](https://github.com/daddel80/notepadpp-multireplace/blob/main/license.txt)
[![Latest Stable Version](https://img.shields.io/badge/version-3.1.2.18-blue)](https://github.com/daddel80/notepadpp-multireplace/releases/tag/3.1.2.18)
[![Latest Stable Version](https://img.shields.io/badge/version-4.0.0.19-blue)](https://github.com/daddel80/notepadpp-multireplace/releases/tag/4.0.0.19)
[![Total Downloads](https://img.shields.io/github/downloads/daddel80/notepadpp-multireplace/total?logo=github)](https://github.com/daddel80/notepadpp-multireplace/releases)

MultiReplace is a Notepad++ plugin that allows users to create, store, and manage search and replace strings within a list, perfect for use across different sessions or projects. It increases efficiency by enabling multiple replacements at once, supports sorting and applying operations to specific columns in CSV files, and offers flexible options for replacing text in various ways.
Expand Down Expand Up @@ -137,6 +137,8 @@ Initializes custom variables for use in various commands, extending beyond stand

Custom variables maintain their values throughout a single Replace-All or within the list of multiple Replace operations. So they can transfer values from one list entry to the following ones. They reset at the start of each new document in 'Replace All in All Open Documents'.

**Note**: An empty Find string can be used to set variables for the entire Find and Replace list without linking it to a specific Find action. This string will not match any text but is triggered at the start of 'Replace' or 'Replace All' process when 'Use List' is enabled, allowing the Replace field to initialize commands like init() for the entire operation. The position of the entry in the list is irrelevant.

| Find: | Replace: | Before | After |
|------------------|---------------------------------------------------------------------------------------------------------------|------------------------------------|-------------------------------------------|
| `(\d+)` | `init({COL2=0,COL4=0}); cond(LCNT==4, COL2+COL4); if COL==2 then COL2=CAP1 end; if COL==4 then COL4=CAP1 end;` | `1,20,text,2,0`<br>`2,30,text,3,0`<br>`3,40,text,4,0` | `1,20,text,2,22.0`<br>`2,30,text,3,33.0`<br>`3,40,text,4,44.0` |
Expand Down Expand Up @@ -255,6 +257,7 @@ Additional Interactions:

### Import/Export
- Supports import/export of search and replace strings with their options in CSV format, including selection states.
- Allows loading list files via drag and drop into the Search and Replace list.
- Adherence to RFC 4180 standards for CSV, enabling compatibility and easy interaction with other CSV handling tools.
- Enables reuse of search and replace operations across sessions and projects.

Expand All @@ -264,6 +267,10 @@ Additional Interactions:

## Window and Display Options

### Window Scaling Factor

The MultiReplace plugin window and UI elements can be resized according to preference by setting a custom scaling factor between 0.5 and 2.0 (default: 1.0). This is configured by modifying the `ScaleFactor` variable in the file `C:\Users\<Username>\AppData\Roaming\plugins\config\MultiReplace.ini`.

### Transparency Configuration

You can set the transparency levels for the MultiReplace plugin window in the INI file located at `C:\Users\<YourUsername>\AppData\Roaming\Notepad++\plugins\Config\MultiReplace.ini`.
Expand Down
96 changes: 75 additions & 21 deletions help_use_variables_dark.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<!DOCTYPE HTML>
<html><head><meta charset="utf-8">
<title>MultiRpelace Use Variables Option</title>
<title>MultiReplace Use Variables Option</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
/* Dark Mode Base Styles */
Expand Down Expand Up @@ -76,17 +76,17 @@
background-color: #282c34;
padding: 6px 8px;
border-radius: 5px;
border: 1px solid #3a3c43; /* Angepasste Randfarbe für besseren Kontrast */
border: 1px solid #3a3c43;
font-weight: 600;
font-size: 0.9em;
box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3); /* Stärkerer Schatten für mehr Tiefe */
box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
display: inline-block;
margin: 0 2px;
vertical-align: middle;
line-height: 1.4;
}


/* Base Styles */
html, body {margin: 0; padding: 0; width: 100%; height: 100%;}
body {display: flex; flex-direction: column; font: 1em Calibri, Tahoma, sans-serif;}

Expand Down Expand Up @@ -234,10 +234,57 @@
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

nav.pagenav {
background-color: #eee;
padding: 10px;
border-radius: 8px;
margin-bottom: 20px;
}

nav.pagenav {
background-color: #eee;
padding: 5px;
border-radius: 8px;
margin-bottom: 20px;
display: flex;
flex-direction: column;
align-items: flex-start;
}

nav.pagenav a {
color: #00c;
text-decoration: none;
margin: 0;
padding: 2px 0;
}

nav.pagenav a:hover {
text-decoration: underline;
}

nav.pagenav .sub-item {
margin-left: 15px;
font-size: 0.95em;
}

body.dark-mode nav.pagenav {
background-color: #333;
}

body.dark-mode nav.pagenav a {
color: #89b4ff;
}

body.dark-mode nav.pagenav a:hover {
color: #62d1c3;
}

body.dark-mode nav.pagenav .sub-item {
color: #89b4ff;
}
</style>
<script>

var isDarkModeEnabled = true; // Set this variavle to true or false to activate or deactivate DarkMode
var isDarkModeEnabled = true; // Set this variable to true or false to activate or deactivate DarkMode

function doPageLoad() {
if (document.getElementById("fontdown")) {
Expand Down Expand Up @@ -278,8 +325,8 @@
document.addEventListener('DOMContentLoaded', function() {
console.log("Document loaded");
checkDarkMode();
doPageLoad();
});

</script>

</head>
Expand All @@ -289,18 +336,22 @@

<main>

<div id=centershortlines></div>

<nav class=pagenav>
<a href="#Introduction">Introduction</a>
<a href="#FirstSteps">First steps</a>
<a href="#Variables">Variables</a>
<a href="#Commands">Commands</a>
<a href="#Operators"> Operators</a>
<a href="#IfThenLogic"> If-Then Logic</a>
<a href="#DebugOption"> Debug option</a>
<a href="#FurtherFunctions">Math & String Functions</a>
<a href="#Examples">Examples</a>
<div id="centershortlines"></div>

<nav class="pagenav">
<a href="#Introduction">Introduction</a>
<a href="#FirstSteps">First Steps</a>
<a href="#Variables">Variables</a>
<a href="#Commands">Commands</a>
<a href="#setstrorcalc" class="sub-item">set()</a>
<a href="#condcondition-trueval-falseval" class="sub-item">cond()</a>
<a href="#initvariable1value1-variable2value2" class="sub-item">init()</a>
<a href="#fmtnnum-maxdecimals-fixeddecimals" class="sub-item">fmtN()</a>
<a href="#Operators">Operators</a>
<a href="#IfThenLogic">If-Then Logic</a>
<a href="#DebugOption">Debug Option</a>
<a href="#FurtherFunctions">Math &amp; String Functions</a>
<a href="#Examples">Examples</a>
</nav>

<article>
Expand Down Expand Up @@ -399,11 +450,14 @@ <h3 id="condcondition-trueval-falseval">cond(condition, trueVal, [falseVal])</h3
</tr>
</table>

<h3>init({Variable1=Value1, Variable2=Value2, ...})</h3>
<h3 id="initvariable1value1-variable2value2">init({Variable1=Value1, Variable2=Value2, ...})</h3>
Initializes custom variables for use in various commands, extending beyond standard variables like CNT, MATCH, CAP1. These variables can carry the status of previous find-and-replace operations to subsequent ones.<p>
<p>
Custom variables maintain their values throughout a single Replace-All or within the list of multiple Replace operations. So they can transfer values from one list entry to the following ones. They reset at the start of each new document in 'Replace All in All Open Documents'.
</p>
<p>
<strong>Note:</strong> An empty Find string can be used to set variables for the entire Find and Replace list without linking it to a specific Find action. This string will not match any text but is triggered at the start of the 'Replace' or 'Replace All' process when 'Use List' is enabled, allowing the Replace field to initialize commands like init() for the entire operation. The position of the entry in the list is irrelevant.
</p>
<table class="optionsTable">
<tr>
<th>Find:</th>
Expand All @@ -425,7 +479,7 @@ <h3>init({Variable1=Value1, Variable2=Value2, ...})</h3>
</tr>
</table>

<h3>fmtN(num, maxDecimals, fixedDecimals)</h3>
<h3 id="fmtnnum-maxdecimals-fixeddecimals">fmtN(num, maxDecimals, fixedDecimals)</h3>
<p>Formats numbers based on precision (maxDecimals) and whether the number of decimals is fixed (fixedDecimals being true or false).</p>
<p><strong>Note</strong>: The <code>fmtN</code> command can exclusively be used within the <code>set</code> and <code>cond</code> commands.</p>
<table class="optionsTable">
Expand Down
95 changes: 75 additions & 20 deletions help_use_variables_light.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

<!DOCTYPE HTML>
<html><head><meta charset="utf-8">
<title>MultiRpelace Use Variables Option</title>
<title>MultiReplace Use Variables Option</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
/* Dark Mode Base Styles */
Expand Down Expand Up @@ -76,17 +75,17 @@
background-color: #282c34;
padding: 6px 8px;
border-radius: 5px;
border: 1px solid #3a3c43; /* Angepasste Randfarbe für besseren Kontrast */
border: 1px solid #3a3c43;
font-weight: 600;
font-size: 0.9em;
box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3); /* Stärkerer Schatten für mehr Tiefe */
box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
display: inline-block;
margin: 0 2px;
vertical-align: middle;
line-height: 1.4;
}


/* Base Styles */
html, body {margin: 0; padding: 0; width: 100%; height: 100%;}
body {display: flex; flex-direction: column; font: 1em Calibri, Tahoma, sans-serif;}

Expand Down Expand Up @@ -234,6 +233,54 @@
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

nav.pagenav {
background-color: #eee;
padding: 10px;
border-radius: 8px;
margin-bottom: 20px;
}

nav.pagenav {
background-color: #eee;
padding: 5px;
border-radius: 8px;
margin-bottom: 20px;
display: flex;
flex-direction: column;
align-items: flex-start;
}

nav.pagenav a {
color: #00c;
text-decoration: none;
margin: 0;
padding: 2px 0;
}

nav.pagenav a:hover {
text-decoration: underline;
}

nav.pagenav .sub-item {
margin-left: 15px;
font-size: 0.95em;
}

body.dark-mode nav.pagenav {
background-color: #333;
}

body.dark-mode nav.pagenav a {
color: #89b4ff;
}

body.dark-mode nav.pagenav a:hover {
color: #62d1c3;
}

body.dark-mode nav.pagenav .sub-item {
color: #89b4ff;
}
</style>
<script>

Expand Down Expand Up @@ -282,25 +329,30 @@

</script>


</head>
<body>

<header>MultiReplace: "Use Variables" Feature Guide</header>

<main>

<div id=centershortlines></div>

<nav class=pagenav>
<a href="#Introduction">Introduction</a>
<a href="#FirstSteps">First steps</a>
<a href="#Variables">Variables</a>
<a href="#Commands">Commands</a>
<a href="#Operators"> Operators</a>
<a href="#IfThenLogic"> If-Then Logic</a>
<a href="#DebugOption"> Debug option</a>
<a href="#FurtherFunctions">Math & String Functions</a>
<a href="#Examples">Examples</a>
<div id="centershortlines"></div>

<nav class="pagenav">
<a href="#Introduction">Introduction</a>
<a href="#FirstSteps">First Steps</a>
<a href="#Variables">Variables</a>
<a href="#Commands">Commands</a>
<a href="#setstrorcalc" class="sub-item">set()</a>
<a href="#condcondition-trueval-falseval" class="sub-item">cond()</a>
<a href="#initvariable1value1-variable2value2" class="sub-item">init()</a>
<a href="#fmtnnum-maxdecimals-fixeddecimals" class="sub-item">fmtN()</a>
<a href="#Operators">Operators</a>
<a href="#IfThenLogic">If-Then Logic</a>
<a href="#DebugOption">Debug Option</a>
<a href="#FurtherFunctions">Math &amp; String Functions</a>
<a href="#Examples">Examples</a>
</nav>

<article>
Expand All @@ -313,7 +365,7 @@ <h2>Introduction</h2>
<h2>First step</h2>
Utilize either the <a href="#setstrorcalc"><code>set()</code></a> or <a href="#condcondition-trueval-falseval"><code>cond()</code></a> command in 'Replace with:' to channel the output as the replacement string. Only one of these commands should be used at a time.
</section>

<section id=Variables>
<h2>Variables</h2>
<table class="optionsTable">
Expand Down Expand Up @@ -399,11 +451,14 @@ <h3 id="condcondition-trueval-falseval">cond(condition, trueVal, [falseVal])</h3
</tr>
</table>

<h3>init({Variable1=Value1, Variable2=Value2, ...})</h3>
<h3 id="initvariable1value1-variable2value2">init({Variable1=Value1, Variable2=Value2, ...})</h3>
Initializes custom variables for use in various commands, extending beyond standard variables like CNT, MATCH, CAP1. These variables can carry the status of previous find-and-replace operations to subsequent ones.<p>
<p>
Custom variables maintain their values throughout a single Replace-All or within the list of multiple Replace operations. So they can transfer values from one list entry to the following ones. They reset at the start of each new document in 'Replace All in All Open Documents'.
</p>
<p>
<strong>Note:</strong> An empty Find string can be used to set variables for the entire Find and Replace list without linking it to a specific Find action. This string will not match any text but is triggered at the start of the the 'Replace' or 'Replace All' process when 'Use List' is enabled, allowing the Replace field to initialize commands like init() for the entire operation. The position of the entry in the list is irrelevant.
</p>
<table class="optionsTable">
<tr>
<th>Find:</th>
Expand All @@ -425,7 +480,7 @@ <h3>init({Variable1=Value1, Variable2=Value2, ...})</h3>
</tr>
</table>

<h3>fmtN(num, maxDecimals, fixedDecimals)</h3>
<h3 id="fmtnnum-maxdecimals-fixeddecimals">fmtN(num, maxDecimals, fixedDecimals)</h3>
<p>Formats numbers based on precision (maxDecimals) and whether the number of decimals is fixed (fixedDecimals being true or false).</p>
<p><strong>Note</strong>: The <code>fmtN</code> command can exclusively be used within the <code>set</code> and <code>cond</code> commands.</p>
<table class="optionsTable">
Expand Down
Loading

0 comments on commit 1ff3bee

Please sign in to comment.