Skip to content

Commit

Permalink
Improve warning messages for cmd.bond()
Browse files Browse the repository at this point in the history
  • Loading branch information
speleo3 committed Dec 19, 2023
1 parent ad58444 commit 912d856
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions layer3/Executive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9343,7 +9343,9 @@ pymol::Result<> ExecutiveBond(PyMOLGlobals* G, const char* s1, const char* s2,
ObjectMolecule *obj1 = SelectorGetSingleObjectMolecule(G, sele1);
ObjectMolecule *obj2 = SelectorGetSingleObjectMolecule(G, sele2);
if((!obj1) || (!obj2) || (obj1 != obj2)) {
if((!quiet) && (mode == 1)) {
if (!quiet && mode == 1 && //
tmpsele1->getAtomCount() > 0 && //
tmpsele2->getAtomCount() > 0) {
PRINTFB(G, FB_Editor, FB_Warnings)
"Editor-Warning: bonds cannot be created between objects, only within.\n"
ENDFB(G);
Expand Down Expand Up @@ -9397,16 +9399,16 @@ pymol::Result<> ExecutiveBond(PyMOLGlobals* G, const char* s1, const char* s2,
switch (mode) {
case 1:
PRINTFB(G, FB_Editor, FB_Warnings)
"Bond-Warning: no bonds added." ENDFB(G);
"Bond-Warning: no bonds added.\n" ENDFB(G);
break;
case 2:
PRINTFB(G, FB_Editor, FB_Warnings)
"Valence-Warning: no bond valences changed." ENDFB(G);
"Valence-Warning: no bond valences changed.\n" ENDFB(G);
break;
case 0:
default:
PRINTFB(G, FB_Editor, FB_Warnings)
"Unbond-Warning: no bonds removed." ENDFB(G);
"Unbond-Warning: no bonds removed.\n" ENDFB(G);
break;
}
}
Expand Down

0 comments on commit 912d856

Please sign in to comment.