Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selecting error lines #899

Open
philiprbrenan opened this issue Feb 8, 2016 · 8 comments
Open

Selecting error lines #899

philiprbrenan opened this issue Feb 8, 2016 · 8 comments

Comments

@philiprbrenan
Copy link

changeonerrors

Please consider providing the ability to select all lines flagged with errors
so that subsequent change operations can be restricted to them.

I posted this on Scintilla and got:

Scintilla provides basic operations that can be combined by the application or
user into user commands.

This looks to me as if it would be best implemented as a user macro command or
language mode rather than as a Scintilla API or editor command. Its possible
that additions to Scintilla would make implementing such a macro easier but
that should be driven by the experience of people trying to implement this at a
higher level.

Thanks!

@b4n
Copy link
Member

b4n commented Feb 8, 2016

I'm not quite sure how often it could be useful (nor exactly what you mean by "so that subsequent change operations can be restricted to them"). Performing the same action on all error lines would mean that they all have the same error, which is not very likely if there are more than one.
IMO your screenshot example is very marginal and specific. Also, wouldn't it be served just fine replacing \$w-> with something::\0 on mostly the whole document (not only the error lines), or whatever the fix is?

This said, I'm not against such a possibility either, and it wouldn't be intrusive. Could be done by a plugin, too, BTW.

But as Neil would said, "I won't be working on this myself".

@b4n b4n added the enhancement label Feb 8, 2016
@philiprbrenan
Copy link
Author

philiprbrenan commented Feb 8, 2016 via email

@elextr
Copy link
Member

elextr commented Feb 8, 2016

Geany does not support multiple selections. Adding it would require changing everything inthe Geany ecosystem, including all plugins to accept multiple selections. Since there are much more compelling use-cases for multiple selections, and they have not offered enough benefit for "somebody" to do the large amount of work needed, then this is unlikely to do so.

Adding it in a plugin as @b4n said restricts what it would affect.

@b4n
Copy link
Member

b4n commented Feb 8, 2016

@elextr while it's true we don't have special handling for multiple selections, it's only a missing feature and creating multiple selection won't break anything in Geany per se. The "only" problem is that they wouldn't be take into account in most code paths, so would have some somehow unexpected behavior.
Just saying, as your remark was kinda scary :) So a plugin creating such a selection and working on it won't break anything.

@philiprbrenan
Copy link
Author

I urge that there be two types of selection.

(1) Normal Selection - the normal one that continues to function exactly is.

(2) Lines selection. I.e. for each edit line there is a bit that says
whether this entire line is selected as part of the lines selection or
not. Find, F3, errors, and other sources might at user discretion be
allowed to include their lines or remove their lines from this selection.
A line being in the selection would be shown by some highlighting of the
line number. Change would have a check box to determine whether only lines
in the lines selection were to be affected or not.

Of course one could go much further and have several bits for each line
(perhaps making a colour) and then change could be optionally restricted to
all red lines or all all red lines union all green lines.

The advantage to users with large files is that they could designate
portions of their files by colours and operate on the entire file or colour
selected subsets - gaining the advnateg of global changes withoiut having
tehm go to far.

Thank you for your esteemed consideration of this feature which I think
would provide yet another unique point of difference between Geany and
other text editors and one that would greatly appeal to new users being so
colourful and easy to explain.

This minimizes disruption while allowing uses with large files to

Thanks,

Phil

Philip R Brenan

On Mon, Feb 8, 2016 at 10:41 PM, elextr notifications@github.com wrote:

Geany does not support multiple selections. Adding it would require
changing everything inthe Geany ecosystem, including all plugins to accept
multiple selections. Since there are much more compelling use-cases for
multiple selections, and they have not offered enough benefit for
"somebody" to do the large amount of work needed, then this is unlikely to
do so.

Adding it in a plugin as @b4n https://github.com/b4n said restricts
what it would affect.


Reply to this email directly or view it on GitHub
#899 (comment).

@b4n
Copy link
Member

b4n commented Feb 8, 2016

@philiprbrenan Multiple separate selections are already supported by Scintilla, we don't really have to add anything here. And those selections are just line normal selections, but multiple: they can span any arbitrary range, it being a line or not. All we would have to add is means to create such selections, and logic in the various functions to handle them when they are created.

@elextr
Copy link
Member

elextr commented Feb 8, 2016

The "only" problem is that they wouldn't be take into account in most code paths, so would have some somehow unexpected behaviour.

Yes, thats why it would require changing lots. Even if a particular code path didn't break, the fact that it only worked on the first selection would be obvious enough to require fixing.

Of course its a mere matter of programming :)

@elextr
Copy link
Member

elextr commented Feb 8, 2016

All we would have to add is means to create such selections,

Do you mean from error markers? IIUC scintilla supports the standard CTRL-swipe if its turned on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants