Comments (12)
Maybe some interesting related links? :
https://notepad-plus-plus.org/community/topic/13277/pythonscript-show-console-on-error
posting by me here:
https://notepad-plus-plus.org/community/topic/14130/hide-or-toggle-find-results-panel-with-keyboard-command
from pythonscript.
and its tab activated (if not already, in a multitab situation--I have the Find-result panel and PS Console as multi-tab in a single window) when PS code writes something to the console.
Good point.
👍
from pythonscript.
I wasn't clear - if you start a subprocess and try to do something with it, it might return an
output like "not supported with this version". How should a program know this?
What I can think of is that PS treats all messages which are send to stderr as error messages,
but messages sent to stdout should be treated as non-error messages which would mean
if someone is redirecting stdout to stderr it would be seen as error.
from pythonscript.
Thank you for the links.
So I'm not the first user addressing this issue.
I think it would be good to integrate this option in PS (with or w/o a user preference).
from pythonscript.
I fully support this issue. In addition, I would like to see the PS Console opened (if not already) and its tab activated (if not already, in a multitab situation--I have the Find-result panel and PS Console as multi-tab in a single window) when PS code writes something to the console. This is typically in the form of a "print" statement but could be any console write. I'm not sure if this kind of thing "burdens" the plugin too much at runtime...
from pythonscript.
but could be any console write
If you mean any console.write()
in a script, I think it should depend on a (separate) user-preference.
from pythonscript.
@Yaron10 , maybe so...maybe so... :)
As always, with software things get complicated fast...deserves some well-thought-out design!
from pythonscript.
Opening/activating the console on error can be implemented even without a user-preference IMO.
console.write()
in a script is fundamentally different and should therefore depend on a user-preference.
Anther option: console.write()
can have another parameter activateConsloe
defaulted to false
.
from pythonscript.
But what is an error? Traceback messages only? Python syntax errors? Errors from a external process?
Messages written with writeError function? Raise calls might be or might be not an error ... ?
from pythonscript.
Any error message not initiated directly by the user.
If implemented, flashing NPP window can be a nice addition.
And console.writeError()
(like console.write()
) can have another parameter activateConsloe
defaulted to false
.
from pythonscript.
I've never tried starting a sub-process nor am I fully familiar with redirecting stdout to stderr.
So I believe your suggestion is clever as always. :)
Thank you.
from pythonscript.
Maybe the low-hanging fruit is best dealt with first. Many times I run a script and something unexpected happens, and my editor tab text doesn't change as I expect, and I am left wondering...because the PS Console is not currently being shown. When I then show the PS console I see something like this:
Traceback (most recent call last):
File "", line 1, in
NameError: name 'a' is not defined
So as a first pass, I would think that anytime a "traceback" is generated, the PS console should be shown to the user if not currently visible.
I think trying to catch things like this example with this kind of feature is a bit ambitious: ...start a subprocess ...it might return an output like "not supported with this version"
.
from pythonscript.
Related Issues (20)
- Custom autocomplete provider. HOT 3
- ColourElement routines cannot accept alpha values HOT 4
- Problem with editor.research() taking None for maxCount parameter HOT 2
- Run Previous Script HOT 3
- Add Begin/End Select in Column Mode to MENUCOMMAND
- editor.hideLines() doesn't show green triangles for showing (unhiding) the lines HOT 9
- [Feature Req.] Add UI indication of script running/not-running status HOT 2
- Escape key in console should change focus to the current Scintilla Editor buffer
- in configuration window, not all instructions visible HOT 3
- Still runs using Python 2.7 - super-outdated HOT 2
- Suggestion: improve structure of Doc
- `doc/intro.html#the-callback-smallprint` needs more detailed/improved explanations HOT 11
- (bug?) error for raw strings that contain `\` at the end HOT 1
- [feature req.] Menu entry (command for shortcut) to Run the script in the current tab HOT 15
- `exit()` in a pythonscript causes Notepad++ to CRASH HOT 13
- add support for notepad.allocateIndicator function HOT 3
- editor.getUserLineSelection() and editor.getUserCharSelection() should allow other defaults if empty selection HOT 13
- Script hangs when using notepad.runMenuCommand with non-existent menu items HOT 5
- No more compatibile Notepad plugin HOT 8
- Console not persistent visible during relaunch HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pythonscript.