Selected text
-
@RuudSchmeitz said in Selected text:
so I know what the actual characters are .
Ever heard of embedded tab characters, or trailing spaces?
Both undesirable, and both usually unseen. -
@Alan-Kilborn said in Selected text:
Ever heard of embedded tab characters, or trailing spaces?
Both undesirable, and both usually unseen.I don’t use tabs , and spaces are visible as dots .
See my Notepad++ settings at :
https://community.notepad-plus-plus.org/topic/20191/bug-in-python-script -
@RuudSchmeitz said in Selected text:
I don’t use tabs
Smart. :-)
(Although if Notepad++ could to “tab indent space align” behavior, I would be all in favor of tab chars)and spaces are visible as dots
Yes, in Notepad++
(You were praising the Delphi view, but I don’t see any visible space mechanism there – I guess you were just praising the calming blueness of the selection) -
@Alan-Kilborn said in Selected text:
@RuudSchmeitz said in Selected text:
Yes, in Notepad++
(You were praising the Delphi view, but I don’t see any visible space mechanism there – I guess you were just praising the calming blueness of the selection)Exactly !
😉 -
@RuudSchmeitz
I just discovered that this bit of Pythonscript magic seems to do what you want for the selection:
editor.setSelEOLFilled(True)
Sample:
Same sample before applying:
-
@Alan-Kilborn said in Selected text:
@RuudSchmeitz
I just discovered that this bit of Pythonscript magic seems to do what you want for the selection:
editor.setSelEOLFilled(True)
I’m sorry for the late response : I only saw your 27-Oct-response today .
I added the line editor.setSelEOLFilled(True) at the end of the startup.py file , and it works perfectly !
Thanks Alan !
-
@RuudSchmeitz
Actually, I’ve been using it for a while now, and I tend to like it as well!
-
@Alan-Kilborn said in Selected text:
@RuudSchmeitz
I just discovered that this bit of Pythonscript magic seems to do what you want for the selection:
editor.setSelEOLFilled(True)
One last question : where did you find the Pythonscript ?
I’m looking for a way to change the ‘White space symbol’ . Perhaps there already is a Pythonscript to do this . -
@Ruud-Schmeitz said in Selected text:
where did you find the Pythonscript ?
Not sure I understand the question, exactly.
It isn’t much of a script, it is just a one-liner that mimics the Scintilla command SCI_SETSELEOLFILLED.
If you can elaborate more on what you mean, I’ll certainly try to answer…I’m looking for a way to change the ‘White space symbol’
I don’t think you reasonably can do this.
What’s wrong with the existing one?
What would you change it to? -
Not sure I understand the question, exactly.
It isn’t much of a script, it is just a one-liner that mimics the Scintilla command SCI_SETSELEOLFILLED.
If you can elaborate more on what you mean, I’ll certainly try to answer…I clicked on the link , and the Scintilla-page sort of answers my question .
This is new to me . Are all those Scintilla-commands available for Notepad++ ?I don’t think you reasonably can do this.
What’s wrong with the existing one?
What would you change it to?The dots in the middle of the space-character can be a bit confusing . Changing the color of the White space symbols is not always enough .
I would rather have (a small version of) the underscore as White space symbol . -
where did you find the Pythonscript
All the PythonScript commands are found in the Plugins > Python Script > Context-Help which is bundled with the PythonScript plugin; that menu command opens a local set of HTML files in your default web browser; in the table of contents on the left, the Notepad++ Object and Editor Object pages will be the ones you use for finding out what goes with
notepad.*
andeditor.*
I’m looking for a way to change the ‘White space symbol’
As far as I can tell, it’s not a “symbol”, per se. SCI_WHITESPACESIZE calls them “dots”. The size is 0 for invisible, or 2 when you turn on viewing whitespace. But when you change the size, using the PythonScript
editor.setWhitespaceSize(size)
command, you see that it’s likely not a symbol/character; it appears that PythonScript is drawing asize ✕ size
square – and if you setsize
bigger than about half the font height, the “dots” start blending together.So if your goal in changing the “symbol” is to make them slightly bigger, you can just use
editor.setWhitespaceSize(size)
to change the dimensions of the “dot”.Otherwise, you can use SCI_SETREPRESENTATION through
editor.setRepresentation(' ', 'SP')
, and it will change the visual display of the space character toSP
in a black box. Change the'SP'
to a string containing whatever black-boxed character(s) you’d like to see. (This is technically not part of the view-whitespace setting; however, it accomplishes the goal of changing what you see instead of the dot.) If you want to undo this change, useeditor.clearRepresentation(' ')
-
@PeterJones said in Selected text:
All the PythonScript commands are found in the Plugins > Python Script > Context-Help which is bundled with the PythonScript plugin; that menu command opens a local set of HTML files in your default web browser; in the table of contents on the left, the Notepad++ Object and Editor Object pages will be the ones you use for finding out what goes with
notepad.*
andeditor.*
I tried your suggestion , Peter :
Plugins > Python Script > Context-Helpbut instead of the PythonScript commands , I got this error-message :
Despite the error-message , the folder does exist !
So I double-clicked on file index.html in folder :
C:\Program Files\Notepad++\plugins\PythonScript\doc
and got the information you described .I’m not sure what caused the error . It could be the space in C:\Program Files… .
-
It looks like it’s building the path incorrectly, with the
c:\program files\notepad++\
portion twice in the path, which isn’t going to work.You might want to go to the PythonScript repo and report that as a minor issue.
-
May ask you how you installed PythonScript plugin and which
version you are using (either use about from the menu or the
output from the console)?
I remember seeing this strange path in an older version of PS,
but should be fixed already. -
@Ekopalypse said in Selected text:
May ask you how you installed PythonScript plugin and which
version you are using (either use about from the menu or the
output from the console)?
I remember seeing this strange path in an older version of PS,
but should be fixed already.This is how I installed Python Script :
• start Notepad++
• in menubar , click on Plugins
• in list , click on Plugins Admin…
• in list , select PythonScript
• click on Installand this is the version I’m using :
-
Thanks, yes, that is the latest stable version.
Hmm strange - I’ll have to do some tests. -
Seems to work for me.
Can you do me another favor and post your debug-info
which is available from the last menu entry, the ? menu? -
@Ekopalypse said in Selected text:
Seems to work for me.
Can you do me another favor and post your debug-info
which is available from the last menu entry, the ? menu?The requested debug-info :
-
This post is deleted! -
@PeterJones said in Selected text:
Otherwise, you can use SCI_SETREPRESENTATION through
editor.setRepresentation(' ', 'SP')
, and it will change the visual display of the space character toSP
in a black box. Change the'SP'
to a string containing whatever black-boxed character(s) you’d like to see. (This is technically not part of the view-whitespace setting; however, it accomplishes the goal of changing what you see instead of the dot.) If you want to undo this change, useeditor.clearRepresentation(' ')
Like I wrote before , I’m looking for a way to use (a small version of) the underscore as White space symbol .
In the Python Script documentation :
file:///C:/Program%20Files/Notepad++/plugins/PythonScript/doc/scintilla.html#scintilla-methodsI found 3 promising Python Script commands to achieve this :
editor.setRepresentation(encodedCharacter, representation)
editor.setWhitespaceFore(useSetting, fore)
editor.setWhitespaceBack(useSetting, back)Then I did some testing (I used ‘-’ instead of ‘_’ for testing purposes) .
Original code :
Script 1
editor.setRepresentation(’ ', ‘-’)
editor.setWhitespaceFore(1,( 64, 64, 64))
editor.setWhitespaceBack(1,(255,255,255))Result after running Script 1 :
• the first command has been executed
• the second and third have been ignoredScript 2
editor.setWhitespaceFore(1,( 64, 64, 64))
editor.setWhitespaceBack(1,(224,224,224))
editor.setRepresentation(’ ', ‘-’)Result after running Script 2:
• the first and second command have been executed .
• the third has been ignored .I’m obviously doing something wrong .
Are those commands commands mutually exclusive ?