mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-152063 IntelliJ fails to use encoding from project settings for files containing breakpoints when project is opened: do not send event on encoding reset
This commit is contained in:
@@ -523,6 +523,10 @@ public abstract class VirtualFile extends UserDataHolderBase implements Modifica
|
||||
}
|
||||
|
||||
public void setCharset(final Charset charset, @Nullable Runnable whenChanged) {
|
||||
setCharset(charset, whenChanged, false);
|
||||
}
|
||||
|
||||
public void setCharset(final Charset charset, @Nullable Runnable whenChanged, boolean suppressEvents) {
|
||||
final Charset old = getStoredCharset();
|
||||
storeCharset(charset);
|
||||
if (Comparing.equal(charset, old)) return;
|
||||
@@ -535,7 +539,9 @@ public abstract class VirtualFile extends UserDataHolderBase implements Modifica
|
||||
|
||||
if (old != null) { //do not send on detect
|
||||
if (whenChanged != null) whenChanged.run();
|
||||
VirtualFileManager.getInstance().notifyPropertyChanged(this, PROP_ENCODING, old, charset);
|
||||
if (!suppressEvents) {
|
||||
VirtualFileManager.getInstance().notifyPropertyChanged(this, PROP_ENCODING, old, charset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -638,7 +638,7 @@ public class FileDocumentManagerImpl extends FileDocumentManager implements Virt
|
||||
documentEx.setReadOnly(false);
|
||||
LoadTextUtil.setCharsetWasDetectedFromBytes(file, null);
|
||||
file.setBOM(null); // reset BOM in case we had one and the external change stripped it away
|
||||
file.setCharset(null);
|
||||
file.setCharset(null, null, true);
|
||||
if (!isBinaryWithoutDecompiler(file)) {
|
||||
documentEx.replaceText(LoadTextUtil.loadText(file), file.getModificationStamp());
|
||||
documentEx.setReadOnly(!wasWritable);
|
||||
|
||||
Reference in New Issue
Block a user