IDEA-171674 First tab is very short in the left Diff pane

This commit is contained in:
Dmitry Batrak
2017-04-24 18:43:43 +03:00
parent 81c8ab0ddd
commit 7718ecd3fb
2 changed files with 5 additions and 3 deletions
@@ -359,7 +359,8 @@ public final class EditorUtil {
}
public static int nextTabStop(int x, @NotNull Editor editor, int tabSize) {
return nextTabStop(x, getSpaceWidth(Font.PLAIN, editor), tabSize);
int leftInset = editor.getContentComponent().getInsets().left;
return nextTabStop(x - leftInset, getSpaceWidth(Font.PLAIN, editor), tabSize) + leftInset;
}
public static int nextTabStop(int x, int plainSpaceWidth, int tabSize) {
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -109,6 +109,7 @@ class TabFragment implements LineFragment {
}
private float getNextTabStop(float x) {
return EditorUtil.nextTabStop((int)x, myView.getPlainSpaceWidth(), myView.getTabSize());
int leftInset = myView.getInsets().left;
return EditorUtil.nextTabStop((int)x - leftInset, myView.getPlainSpaceWidth(), myView.getTabSize()) + leftInset;
}
}