diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/ex/util/EditorUtil.java b/platform/platform-impl/src/com/intellij/openapi/editor/ex/util/EditorUtil.java index c4b8d0d38370..bfabf9e3b845 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/ex/util/EditorUtil.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/ex/util/EditorUtil.java @@ -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) { diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/view/TabFragment.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/view/TabFragment.java index 1b2f2135572d..dd67cff0fb9b 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/view/TabFragment.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/view/TabFragment.java @@ -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; } }