dail8859 / LuaScript

Notepad++ plugin for Lua scripting capabilities

Home Page:https://dail8859.github.io/LuaScript/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Please add a button to clear the console

verdy-p opened this issue · comments

Please add a button to clear the console log panel (so we don't need to remember and type "npp.ClearConsole()" and run this line).

Some scripts could generate lot of data in the console, and the console content is kept in memory, even when we close the console (there could be a checkbox allowing the console and its own history for the input line to be cleared.

As well the input box for the command to run is limited to a single line, it could be extensible (even if wa can also use the editor1 or editor2 to edit scripts that we'll load and run with a button, whose result could be posted in an editor or in the readonly console log panel.

Please add a button to clear the console log panel

You can right click the console and there is a clear option.

As well the input box for the command to run is limited to a single line

You can do multi line statements by pressing Shift+Enter (maybe it is Ctrl+Enter...can't remember currently).

it could be extensible (even if wa can also use the editor1 or editor2 to edit scripts that we'll load and run with a button, whose result could be posted in an editor or in the readonly console log panel.

Not sure I understand exactly. Do you have any particular examples or use cases?

I did not see there was a right-click menu. Even if I use it since long (I had an issue because for a test, I had run some command that unexpected generated gigabytes of output in the log (which does not seem to have any maximum size), so NPP froze, and crashed.

Also the limitation of the input line to just one line displayed is not very practical, whe should still be able to increased the height (for multistatement or not, does not matter if long lines can wrap there).

I wonder if it was possible to just merge the output log and the input in the same window, like on a classic command console for a shell (with read-only lines at top, the input lines at bottom of the text being editable), or no limitation at all in the log, so we can freely edit it, then select a part for execution (by default the run button would run only the lines added at the bottom below the last log position).

Anyway thanks for pointing the right-click menu in the console log.

which does not seem to have any maximum size

There is no size restriction. If this is needed to prevent crashes I'd recommend using LuaScript to periodically check the size of the console and then deleting part of the text.

Also the limitation of the input line to just one line displayed is not very practical

It is not limited to just one line.

I wonder if it was possible to just merge the output log and the input in the same window, like on a classic command console

I tried this at one point but it is just too difficult to restrict where edits are allowed to take place...and then determine what is commands vs what is output.

notebook style editing would be nice

I think you can delimeter output/input zone by scintilla annotations or smth like that

I'm sure it is technically possible to merge the input and output but that would take alot of work and actually make some of the current functionality difficult/ impossible (e.g. Lua highlighting).

If someone was interested in implementing it I'd be willing to discuss what kind of functionality I would expect from it. However it is not a simple code change so I'm not sure if anyone is interested.

I don't see why Lua Highlighting would not work; the Highlighting uses internally attributes on the text, and one of the attributes can mark what is the current input (a special "color" used for the last lines of the console).
Anyway, even what you input on the console input is/should be colorable as well. So coloring is not really the issue; all we need is to mark a set of lines at the bottom of the text.
You don't need to allow input elsewhere than on the bottom lines.

This is what is done in shell command consoles (which just handles an additional cursor position for the position of input in the bottom lines, while the top lines showing the ouput history is just readonly, and insertion always occurs at the bottom of text).
Anyway, the "Clear console" button should still be added (not really a complex issue), even if you've got a right-click menu (not obvious to see and less practical than a right-click menu).

I don't see why Lua Highlighting would not work; the Highlighting uses internally attributes on the text

I don't know of any way to turn highlighting on and off per line. The output text should not be highlighted.

You don't need to allow input elsewhere than on the bottom lines.

Easier said than done. I tried this at one point and I couldn't get it working the way I wanted. I'm not saying it is impossible, just that I don't have the time myself to try to get this implemented correctly.

Anyway, the "Clear console" button should still be added

I don't plan to add an additional button just to clear the console. If you need a quick way to clear it you could create a keyboard shortcut to call npp.ClearConsole()