At jEdit trunk r8210, I saw a NPE from getIndentRulse(). I could reproduce it with [Record Temporary Macro] > [Stop Recording]. The attached patch will fix this problem. Though the patch is working fine, I don't know why lineMgr.getLineContext(line) returns null with the above operation. I made this patch to be the least change to avoid an actual problem. But the function seemed to rely on some unclear non-null assumptions. - tokenMarker.getMainRuleSet() - getMainRuleSet().getModeName() - jEdit.getMode(modeName) - getMode(modeName).getIndentRules() If these can be problems, I think the patch should be revised.