Fix command name and expose settings
This commit is contained in:
@@ -1,6 +1,11 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"caption": "Clear Text",
|
"caption": "TextCleaner: Clean Text",
|
||||||
"command": "text_cleaner"
|
"command": "text_cleaner"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"caption": "TextCleaner: Settings",
|
||||||
|
"command": "open_file",
|
||||||
|
"args": {"file": "${packages}/TextCleaner/TextCleaner.sublime-settings"}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|||||||
18
Main.sublime-menu
Normal file
18
Main.sublime-menu
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"id": "preferences",
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"id": "package-settings",
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"caption": "TextCleaner: Settings",
|
||||||
|
"command": "open_file",
|
||||||
|
"args": {"file": "${packages}/TextCleaner/TextCleaner.sublime-settings"}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
@@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
TextCleaner is a Sublime Text 4 plugin that cleans up your document by performing several text transformations. It converts tabs to spaces, replaces invisible characters, standardizes quotes, trims extra whitespace, collapses multiple spaces, removes duplicate empty lines, and cleans up empty lines around brackets.
|
TextCleaner is a Sublime Text 4 plugin that cleans up your document by performing several text transformations. It converts tabs to spaces, replaces invisible characters, standardizes quotes, trims extra whitespace, collapses multiple spaces, removes duplicate empty lines, and cleans up empty lines around brackets.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Run the **TextCleaner: Clean Text** command from the Command Palette to tidy up the current file. You can open the plugin settings via the same palette or through the **Preferences → Package Settings → TextCleaner** menu.
|
||||||
|
|
||||||
## Settings
|
## Settings
|
||||||
|
|
||||||
You can customize which transformations are applied through the configuration file ([TextCleaner.sublime-settings](/TextCleaner.sublime-settings)). Below is a description of each setting:
|
You can customize which transformations are applied through the configuration file ([TextCleaner.sublime-settings](/TextCleaner.sublime-settings)). Below is a description of each setting:
|
||||||
@@ -22,4 +26,4 @@ This project is licensed under the [MIT License](/LICENSE.txt).
|
|||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
Developed by **Valentin Popov** ([valentin@popov.link](mailto:valentin@popov.link)).
|
Developed by **Valentin Popov** ([valentin@popov.link](mailto:valentin@popov.link)).
|
||||||
|
|||||||
@@ -48,4 +48,4 @@ class TextCleanerCommand(sublime_plugin.TextCommand):
|
|||||||
content = re.sub(r'\n\s*\n+([)\]}])', r'\n\1', content)
|
content = re.sub(r'\n\s*\n+([)\]}])', r'\n\1', content)
|
||||||
|
|
||||||
# Replace the document text with the cleaned content.
|
# Replace the document text with the cleaned content.
|
||||||
self.view.replace(edit, entire_region, content)
|
self.view.replace(edit, entire_region, content)
|
||||||
|
|||||||
@@ -19,4 +19,4 @@
|
|||||||
|
|
||||||
// Remove empty lines after opening brackets and before closing brackets.
|
// Remove empty lines after opening brackets and before closing brackets.
|
||||||
"remove_empty_lines_around_brackets": true
|
"remove_empty_lines_around_brackets": true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user