-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 32ccb94
Showing
9 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[ | ||
{ "keys": ["ctrl+shift+c"], "command": "remove_extra_right_spaces" } | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[ | ||
{ "keys": ["super+shift+c"], "command": "remove_extra_right_spaces" } | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[ | ||
{ "keys": ["ctrl+shift+c"], "command": "remove_extra_right_spaces" } | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[ | ||
{ | ||
"caption": "Remove extra right spaces", | ||
"command": "remove_extra_right_spaces" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Remove Extra Right Spaces | ||
|
||
This Sublime plugin removes extra right spaces from each line of your code. | ||
|
||
I hope you you find this plugin helpful. | ||
|
||
### Why? | ||
|
||
|
||
|
||
### Installation | ||
|
||
For manual installation, run the following script in the Sublime Text terminal ```(ctrl+`)``` which utilizes ```git clone```. | ||
|
||
```python | ||
import os; path=sublime.packages_path(); (os.makedirs(path) if not os.path.exists(path) else None); window.run_command('exec', {'cmd': ['git', 'clone', 'https://github.com/pererinha/RemoveExtraRightSpaces', 'RemoveExtraRightSpaces'], 'working_dir': path}) | ||
``` | ||
|
||
**It is currently working just for Sublime 3** | ||
|
||
### Usage | ||
* On Mac **Command + Shift + C** | ||
* On Windows or Linux **Ctrl + Shift + C** | ||
|
||
Or | ||
|
||
**Ctrl + Shift + P** and search for *“Remove extra right spaces”* | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"install": "messages/install.txt" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
This is a beta release. | ||
- Not tested on Linux, Windows. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Thanks for installing the Remove Extra Right Spaces plugin. | ||
|
||
This plugin removes extra right spaces from each line of your code. | ||
|
||
I hope you you find this plugin helpful. | ||
|
||
Github page https://github.com/pererinha/RemoveExtraRightSpaces. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import sublime, sublime_plugin | ||
|
||
class RemoveExtraRightSpacesCommand(sublime_plugin.TextCommand): | ||
def run(self, edit): | ||
# I have no idea why the self.view is not returning the region correctly | ||
view = self.view.window().active_view() | ||
region = sublime.Region(0, min(view.size(), 2**14)) | ||
content = view.substr(region) | ||
new_content = '' | ||
for line in content.split( '\n' ): | ||
new_content += line.rstrip() + '\n' | ||
view.replace(edit, region, new_content) | ||
|