-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #324 from smostertdev/lineoperations
Add new "Lineoperations" plugin
- Loading branch information
Showing
15 changed files
with
1,118 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -41,7 +41,6 @@ M: Colomban Wendling <[email protected]> | |
W: | ||
S: Maintained | ||
|
||
|
||
debugger | ||
P: Alexander Petukhov <[email protected]> | ||
M: Alexander Petukhov <[email protected]> | ||
|
@@ -168,6 +167,12 @@ M: Colomban Wendling <[email protected]> | |
W: http://plugins.geany.org/git-changebar.html | ||
S: Maintained | ||
|
||
lineoperations | ||
P: Sylvan Mostert <[email protected]> | ||
M: Sylvan Mostert <[email protected]> | ||
W: | ||
S: Maintained | ||
|
||
markdown | ||
P: Matthew Brush <[email protected]> | ||
M: Matthew Brush <[email protected]> | ||
|
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
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,9 @@ | ||
AC_DEFUN([GP_CHECK_LINEOPERATIONS], | ||
[ | ||
GP_ARG_DISABLE([LineOperations], [auto]) | ||
GP_COMMIT_PLUGIN_STATUS([LineOperations]) | ||
AC_CONFIG_FILES([ | ||
lineoperations/Makefile | ||
lineoperations/src/Makefile | ||
]) | ||
]) |
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
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 @@ | ||
Sylvan Mostert <[email protected]> |
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
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,4 @@ | ||
include $(top_srcdir)/build/vars.auxfiles.mk | ||
|
||
SUBDIRS = src | ||
plugin = lineoperations |
Empty file.
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,222 @@ | ||
=============== | ||
Line Operations | ||
=============== | ||
|
||
.. contents:: | ||
|
||
About | ||
===== | ||
|
||
Line Operations is an assortment of simple line functions that can be | ||
applied to an open file. | ||
|
||
Features | ||
======== | ||
|
||
* Remove Duplicate Lines, sorted | ||
* Remove Duplicate Lines, ordered | ||
* Remove Unique Lines | ||
* Remove Empty Lines | ||
* Remove Whitespace Lines | ||
* Sort Lines Ascending | ||
* Sort Lines Descending | ||
|
||
Usage | ||
===== | ||
|
||
After the plugins has been installed successfully, load the plugin via | ||
Geany's plugin manager and a new menu item in the Tools menu will | ||
appear. Click on each menu item to apply the operation on whole file. | ||
See descriptions below to see operations for each menu item. | ||
|
||
Notes | ||
----- | ||
|
||
* Line Operations will **not** make changes to a file until you save | ||
the file. | ||
|
||
|
||
Operation Details | ||
================= | ||
|
||
Remove Duplicate Lines | ||
---------------------- | ||
|
||
The first occurrence of each duplicate line will remain in the file. | ||
The **Sorted** option will sort the file and remove duplicate lines | ||
[fast on large files]. The **Ordered** option will keep the same order | ||
of lines [slow on large files]. | ||
|
||
Example: Suppose a file has the following lines. (#comments added for | ||
clarity) | ||
|
||
:: | ||
|
||
Line 2 | ||
Line 1 | ||
Line 2 #removed | ||
Line 3 | ||
Line 1 #removed | ||
Line 2 #removed | ||
|
||
The **Remove Duplicate Lines, sorted** will change the file into this: | ||
|
||
:: | ||
|
||
Line 1 | ||
Line 2 | ||
Line 3 | ||
|
||
The **Remove Duplicate Lines, ordered** will change the file into | ||
this: | ||
|
||
:: | ||
|
||
Line 2 | ||
Line 1 | ||
Line 3 | ||
|
||
|
||
|
||
Remove Unique Lines | ||
------------------- | ||
|
||
Removes all lines that appear only once. | ||
|
||
Example: Suppose a file has the following lines. (#comments added for | ||
clarity) | ||
|
||
:: | ||
|
||
Line 2 | ||
Line 1 | ||
Line 2 | ||
Line 3 #removed | ||
Line 1 | ||
Line 2 | ||
|
||
The **Remove Unique Lines** will change the file into this: | ||
|
||
:: | ||
|
||
Line 2 | ||
Line 1 | ||
Line 2 | ||
Line 1 | ||
Line 2 | ||
|
||
Remove Empty Lines | ||
------------------ | ||
|
||
Removes all lines that only contain a newline character, and no other | ||
characters. | ||
|
||
Example: Suppose a file has the following lines. (#comments, and | ||
\\n newline characters added for clarity) | ||
|
||
:: | ||
|
||
Line 2\n | ||
Line 1\n | ||
\n #removed | ||
\n #NOT removed (contains spaces) | ||
Line 1\n | ||
Line 2\n | ||
|
||
The **Remove Empty Lines** will change the file into this: | ||
|
||
:: | ||
|
||
Line 2\n | ||
Line 1\n | ||
\n | ||
Line 1\n | ||
Line 2\n | ||
|
||
|
||
Remove Whitespace Lines | ||
----------------------- | ||
|
||
Removes all lines that have only whitespace characters. | ||
|
||
|
||
Example: Suppose a file has the following lines. (#comments, and \\n | ||
newline characters added for clarity) | ||
|
||
:: | ||
|
||
Line 2\n | ||
Line 1\n | ||
\n #removed | ||
\n #removed (contains only whitespace chars) | ||
\t \n #removed (contains only whitespace chars) | ||
Line 1\n #NOT removed (contains non whitespace chars) | ||
Line 2\n | ||
|
||
The **Remove Whitespace Lines** will change the file into this: | ||
|
||
:: | ||
|
||
Line 2\n | ||
Line 1\n | ||
Line 1\n | ||
Line 2\n | ||
|
||
Sort Lines | ||
---------- | ||
|
||
Sorts lines ascending or descending based on ASCII values | ||
(lexicographic sort). | ||
|
||
|
||
Example: Suppose a file has the following lines. | ||
|
||
:: | ||
|
||
line 1 | ||
line 2 | ||
line | ||
line 3 | ||
line | ||
|
||
The **Sort Lines Ascending** will change the file into this: | ||
|
||
:: | ||
|
||
line | ||
line | ||
line 1 | ||
line 2 | ||
line 3 | ||
|
||
|
||
The **Sort Lines Descending** will change the file into this: | ||
|
||
:: | ||
|
||
line 3 | ||
line 2 | ||
line 1 | ||
line | ||
line | ||
|
||
|
||
License | ||
======= | ||
|
||
The Line Operations plugin is distributed under the terms of the GNU | ||
General Public License as published by the Free Software Foundation; | ||
either version 2 of the License, or (at your option) any later version. | ||
A copy of this license can be found in the file COPYING included with | ||
the source code of this program. | ||
|
||
Ideas, questions, patches and bug reports | ||
========================================= | ||
|
||
Please direct all questions, bug reports and patches to the plugin | ||
author using the email address listed below or to the Geany mailing | ||
list to get some help from other Geany users, or report them at | ||
https://github.com/geany/geany-plugins/issues. | ||
|
||
|
||
|
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,12 @@ | ||
include $(top_srcdir)/build/vars.build.mk | ||
|
||
geanyplugins_LTLIBRARIES = lineoperations.la | ||
|
||
lineoperations_la_SOURCES = \ | ||
linefunctions.h \ | ||
linefunctions.c \ | ||
lineoperations.c | ||
|
||
lineoperations_la_LIBADD = $(COMMONLIBS) | ||
|
||
include $(top_srcdir)/build/cppcheck.mk |
Oops, something went wrong.