From: <kp...@us...> - 2011-03-31 15:47:52
|
Revision: 19499 http://jedit.svn.sourceforge.net/jedit/?rev=19499&view=rev Author: kpouer Date: 2011-03-31 15:47:46 +0000 (Thu, 31 Mar 2011) Log Message: ----------- fix big file loading if userMode is set Modified Paths: -------------- jEdit/trunk/org/gjt/sp/jedit/Buffer.java Modified: jEdit/trunk/org/gjt/sp/jedit/Buffer.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/Buffer.java 2011-03-30 15:43:04 UTC (rev 19498) +++ jEdit/trunk/org/gjt/sp/jedit/Buffer.java 2011-03-31 15:47:46 UTC (rev 19499) @@ -1095,21 +1095,20 @@ */ public void setMode() { + Mode mode = null; String userMode = getStringProperty("mode"); if(userMode != null) { unsetProperty("mode"); - Mode m = ModeProvider.instance.getMode(userMode); - if(m != null) - { - setMode(m); - return; - } + mode = ModeProvider.instance.getMode(userMode); } - String firstLine = getLineText(0); + if (mode == null) + { + String firstLine = getLineText(0); + mode = ModeProvider.instance.getModeForFile(path, firstLine); + } - Mode mode = ModeProvider.instance.getModeForFile(path, firstLine); if (mode != null) { boolean forceInsensitive = false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |