mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-127761 diff: force soft wraps for files with long lines
This check was ignored if soft wraps were enabled in IDE, but disabled in diff viewer
This commit is contained in:
@@ -129,8 +129,10 @@ public class SetEditorSettingsAction extends ActionGroup implements DumbAware {
|
||||
|
||||
@Override
|
||||
public void applyDefaults(@NotNull List<? extends Editor> editors) {
|
||||
for (Editor editor : editors) {
|
||||
if (editor.getUserData(EditorImpl.FORCED_SOFT_WRAPS) != null) myForcedSoftWrap = true;
|
||||
if (!myTextSettings.isUseSoftWraps()) {
|
||||
for (Editor editor : editors) {
|
||||
myForcedSoftWrap = myForcedSoftWrap || ((EditorImpl)editor).shouldSoftWrapsBeForced();
|
||||
}
|
||||
}
|
||||
super.applyDefaults(editors);
|
||||
}
|
||||
|
||||
@@ -344,7 +344,7 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
|
||||
initTabPainter();
|
||||
myIsViewer = viewer;
|
||||
mySettings = new SettingsImpl(this, project);
|
||||
if (shouldSoftWrapsBeForced()) {
|
||||
if (!mySettings.isUseSoftWraps() && shouldSoftWrapsBeForced()) {
|
||||
mySettings.setUseSoftWrapsQuiet();
|
||||
putUserData(FORCED_SOFT_WRAPS, Boolean.TRUE);
|
||||
}
|
||||
@@ -583,10 +583,9 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
|
||||
updateCaretCursor();
|
||||
}
|
||||
|
||||
private boolean shouldSoftWrapsBeForced() {
|
||||
if (mySettings.isUseSoftWraps() ||
|
||||
// Disable checking for files in intermediate states - e.g. for files during refactoring.
|
||||
myProject != null && PsiDocumentManager.getInstance(myProject).isDocumentBlockedByPsi(myDocument)) {
|
||||
public boolean shouldSoftWrapsBeForced() {
|
||||
if (myProject != null && PsiDocumentManager.getInstance(myProject).isDocumentBlockedByPsi(myDocument)) {
|
||||
// Disable checking for files in intermediate states - e.g. for files during refactoring.
|
||||
return false;
|
||||
}
|
||||
int lineWidthLimit = Registry.intValue("editor.soft.wrap.force.limit");
|
||||
|
||||
Reference in New Issue
Block a user