Index: /trunk/src/jlatexeditor/bib/BibCodeHelper.java
===================================================================
--- /trunk/src/jlatexeditor/bib/BibCodeHelper.java	(revision 996)
+++ /trunk/src/jlatexeditor/bib/BibCodeHelper.java	(revision 1019)
@@ -15,4 +15,5 @@
   protected ArrayList<CHCommand> missingParams = null;
 
+  protected PatternPair keyPattern = new PatternPair("(\\w*)");
   public BibCodeHelper() {
     pattern = new PatternPair("^(@\\w*)");
@@ -42,20 +43,26 @@
       missingParams = new ArrayList<CHCommand>();
 
+      params = keyPattern.find(pane);
+      if(params != null) {
+        name = params.get(0);
+      } else {
+        name = new WordWithPos("", row, column);
+      }
+
       ArrayList<String> keys = state.getAllKeys();
       BibEntry entry = BibEntry.getEntry("@" + state.getEntryType());
       if(entry == null) return false;
 
-      ArrayList<String> params = new ArrayList<String>();
-      params.addAll(Arrays.asList(entry.getRequired()));
-      params.addAll(Arrays.asList(entry.getOptional()));
-      for(String param : params) {
-        if(!keys.contains(param)) {
-          CHCommand command = new CHCommand(param);
-          command.setUsage(param + " = {@|@},");
+      ArrayList<String> bibKeys = new ArrayList<String>();
+      bibKeys.addAll(Arrays.asList(entry.getRequired()));
+      bibKeys.addAll(Arrays.asList(entry.getOptional()));
+      for(String bibKey : bibKeys) {
+        if(!keys.contains(bibKey)) {
+          CHCommand command = new CHCommand(bibKey);
+          command.setUsage(bibKey + " = {@|@},");
           missingParams.add(command);
         }
       }
 
-      name = new WordWithPos("", row, column);
       return true;
     }
Index: /trunk/src/jlatexeditor/bib/BibSyntaxHighlighting.java
===================================================================
--- /trunk/src/jlatexeditor/bib/BibSyntaxHighlighting.java	(revision 1002)
+++ /trunk/src/jlatexeditor/bib/BibSyntaxHighlighting.java	(revision 1019)
@@ -250,4 +250,13 @@
 
         byte entryStyle = stateStyles[LatexStyles.MATH_COMMAND];
+
+        BibEntry entry = BibEntry.getEntry("@" + state.getEntryType());
+        if(entry != null) {
+          // non-existing key
+          if(!entry.getAll().contains(key)) {
+            entryStyle = stateStyles[LatexStyles.ERROR];
+          }
+        }
+
         for (int i = 0; i <= key.length(); i++) {
           chars[char_nr + i].style = entryStyle;
Index: /trunk/src/jlatexeditor/bib/BibEntry.java
===================================================================
--- /trunk/src/jlatexeditor/bib/BibEntry.java	(revision 996)
+++ /trunk/src/jlatexeditor/bib/BibEntry.java	(revision 1019)
@@ -3,7 +3,13 @@
 import sce.codehelper.CHCommand;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+
 public class BibEntry extends CHCommand {
   private String[] required;
   private String[] optional;
+  private HashSet<String> all;
 
   public BibEntry(String name, String description, String[] required, String[] optional) {
@@ -13,4 +19,13 @@
     this.required = required;
     this.optional = optional;
+
+    all = new HashSet<String>();
+    List<String> keys = new ArrayList<String>();
+    keys.addAll(Arrays.asList(required));
+    keys.addAll(Arrays.asList(optional));
+    for(String key : keys) {
+      String splits[] = key.split("/");
+      all.addAll(Arrays.asList(splits));
+    }
 
     String usage = "&at;" + name + "{@|@,\n";
@@ -26,4 +41,8 @@
   public String[] getOptional() {
     return optional;
+  }
+
+  public HashSet getAll() {
+    return all;
   }
 
