Using Mark (Markers) and Styles
-
@Sridhar-Raghavan said in Using Mark (Markers) and Styles:
unless Scripting is done carefully, one may easily break the consistencies ensured rigorously in the core code.
Well, to be honest, I think in the core code the hidden line feature is just not that good. So much for the need for “consistencies ensured rigorously”. :-)
And, strangely, in all of the forum postings here, hiding and showing lines again is very rarely discussed. Probably, because in Notepad++ the feature is very basic as I described earlier.
-
@Alan-Kilborn said in Using Mark (Markers) and Styles:
I think in the core code the hidden line feature is just not that good
As an example, it is easy to get the UI out of sync just using the built-in features (no scripting).
Example:
Start with text:
one two three four five six seven eight nine ten
Make a selection of some lines:
Right-click that selection and pick Hide Lines to obtain:
Make another selection, like so:
Right-click that selection and pick Hide Lines to obtain:
Left-click the green arrow in the margin on line 2.
This seems like it should expand the text back to a no-lines-hidden state, or perhaps the previous state where lines 5, 6 and 7 were the only hidden ones.
But what we get is:So we do get the state where lines 5, 6 and 7 are the hidden ones.
But…there’s no way to ever unhide them (well, switching tabs and back does it!)
There’s no right-pointing green arrow, and clicking on the left-pointing arrow does nothing.So the conclusion is that this feature is broken (if I can break it so easily).
-
Thanks Alan for that tip. I would have never found it by trying things (hoping for the hidden commands!). That gets me going now.
Thanks for the quick work on the code for the “windowed” display. Great.
I think your code with additional check boxes and drop downs is rapidly getting to becoming a good plugin!!
It was a general experiential statement on my part that APIs and Scripting languages are after-thought add-ons, done with less rigor. But not always the case, including the example you cite.
br Sri.
-
Hi, @sridhar-raghavan, @alan-kilborn and All,
Just tried your second version, using
1
line before hit and1
line after it. Interesting, indeed, with the “Hide Lines” mechanism. Just enable theline number
margin !Of course, as soon as you switch to another tab and switch back to your file, all the hidden lines appear again !
Now, I thought about two improvements. But, Alan, they are just suggestions and ONLY IF @sridhar-raghavan would need it, too !
-
By default, the
Python
search is sensible to case et does not care about the whole word notion. So, could it possible to search for any case and to search for whole words only ? -
I thought that you could also enter all the parameters in an unique prompt window !
-
With double quotes to surround expressions containing space characters
-
With inside a couple of parentheses :
-
w
would meanWord only
-
i
would meanIgnore case
-
r
would meanRemove all styles
-
#
would mean Style#
-
When absent, each parameter would be supposed to be the default present
Python
script behavior !
So, for instance, the text
License (rw5) software (i3) "GNU GENERAL PUBLIC LICENSE" (iw43)
would mean :-
Remove all styles first
-
Highlight any word
License
, with this exact case, in style5
-
Highlight any string
software
, whatever its case, in style3
-
Highlight any exact expression
GNU GENERAL PUBLIC LICENSE
, whatever its case, in style4
AND in style3
, too
Best Regards,
guy038
-
-
@guy038 said in Using Mark (Markers) and Styles:
Of course, as soon as you switch to another tab and switch back to your file, all the hidden lines appear again !
Yes, this limitation was mentioned earlier.
It can be avoided with more code, but as this was just intended to be a demo to show @Sridhar-Raghavan the possibilities of scripting, I didn’t do it.Regarding other changes: Yes, with scripting the possibilities are limitless! :-)
-
@Alan-Kilborn said in Using Mark (Markers) and Styles:
But…there’s no way to ever unhide them (well, switching tabs and back does it!)
There’s no right-pointing green arrow, and clicking on the left-pointing arrow does nothing.
So the conclusion is that this feature is broken (if I can break it so easily).Maybe you already know, as > 2 years passed, but if not: I could not reproduce that bug, so I guess it’s been fixed.
-
@Victorel-Petrovich said in Using Mark (Markers) and Styles:
Maybe you already know, as > 2 years passed, but if not: I could not reproduce that bug, so I guess it’s been fixed.
Not sure what you mean has been fixed…
-
This post is deleted! -
@Alan-Kilborn , the bug in your message above:
As an example, it is easy to get the UI out of sync just using the built-in features (no scripting).
Example:
Start with text:
one two three four five six seven eight nine ten
Make a selection of some lines:
Right-click that selection and pick Hide Lines to obtain:
Make another selection, like so:
Right-click that selection and pick Hide Lines to obtain:
Left-click the green arrow in the margin on line 2.
This seems like it should expand the text back to a no-lines-hidden state, or perhaps the previous state where lines 5, 6 and 7 were the only hidden ones.
But what we get is:So we do get the state where lines 5, 6 and 7 are the hidden ones.
But…there’s no way to ever unhide them (well, switching tabs and back does it!)
There’s no right-pointing green arrow, and clicking on the left-pointing arrow does nothing.So the conclusion is that this feature is broken (if I can break it so easily).
-
@Victorel-Petrovich said in Using Mark (Markers) and Styles:
the conclusion is that this feature is broken (if I can break it so easily).
it is easy to get the UI out of sync just using the built-in features (no scripting).
Ah, OK – I thought you meant something with the script.
Yes, the feature is very broken, for many reasons.
This has long been known.