I just saw this idea on Stackoverflow and had to try it:
The Initialisation mode has to be ATSTARTUP and the code is placed at the end of the startup.py
files = notepad.getFiles()
# there are always at least 2 'buffers' open in N++
if len(files) == 2:
currentBufferID = notepad.getCurrentBufferID()
for (filename, bufferID, index, view) in files:
if editor.getLength() > 0:
# TODO: just to be on the safe side - if we
# reached here, we actually should also check
# if the 2 left empty buffers are not unsaved,
# but I couldn't find a way to do that.
# following 'menuCommand' looks cleaner than
# the 'sys.exit' but it currently deadlocks N++:
Log in to post a comment.