if config.get("References", "GuessPrefix") == "yes":
args.append("-g")
text = Npp.editor.getSelText()
hasSelectedText = text != ''
if not hasSelectedText:
args.append(["-T", "all"])
text = Npp.editor.getText()
p = subprocess.Popen(
args,
shell=True,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
creationflags=CREATE_NO_WINDOW)
(out, err) = p.communicate(text)
e = p.wait()
if e == 0:
if hasSelectedText:
Npp.editor.replaceSel(out)
else:
Npp.editor.setText(out)
else:
Npp.notepad.messageBox(err, "s1kd-ref")