bruderstein / PythonScript

Python Script plugin for Notepad++
http://npppythonscript.sourceforge.net/
GNU General Public License v2.0
356 stars 66 forks source link

Wrap text in console #330

Closed matthewacarson closed 6 months ago

matthewacarson commented 9 months ago

Hi. Is it possible to wrap the output in the console? Sometimes the output is very long and difficult to read. Thanks!

Ekopalypse commented 7 months ago

The console is a Scintilla instance, as used by Npp itself. You can access it via console.editor and set the wrapping mode with console.editor.setWrapMode. See here for the description of the possible values available via the WRAP class.

chcg commented 7 months ago

@matthewacarson Is enabling warpping via script command sufficient for your needs?

alankilborn commented 7 months ago

Is enabling wrapping via script command sufficient for your needs?

I should think so; with that everyone can easily customize it have exactly what they want; e.g., put the following in user startup.py:

console.editor.setWrapMode(WRAP.WORD)
console.editor.setWrapIndentMode(WRAPINDENTMODE.SAME)
console.editor.setWrapStartIndent(0)
console.editor.setWrapVisualFlags(WRAPVISUALFLAG.END)
console.editor.setWrapVisualFlagsLocation(WRAPVISUALLOCATION.END_BY_TEXT)

Change the parameters to the function as desired.

matthewacarson commented 7 months ago

@matthewacarson Is enabling warpping via script command sufficient for your needs?

Yes!

Is enabling wrapping via script command sufficient for your needs?

I should think so; with that everyone can easily customize it have exactly what they want; e.g., put the following in user startup.py:

console.editor.setWrapMode(WRAP.WORD)
console.editor.setWrapIndentMode(WRAPINDENTMODE.SAME)
console.editor.setWrapStartIndent(0)
console.editor.setWrapVisualFlags(WRAPVISUALFLAG.END)
console.editor.setWrapVisualFlagsLocation(WRAPVISUALLOCATION.END_BY_TEXT)

Change the parameters to the function as desired.

That worked like a charm. Thanks!

chcg commented 6 months ago

Added sample code from here as example script to repo