private void updateStickToEndState(@NotNull EditorEx editor, boolean useImmediatePosition) {
    ThreadingAssertions.assertEventDispatchThread();
    boolean vScrollAtBottom = isVScrollAtTheBottom(editor, useImmediatePosition);
    boolean caretAtTheLastLine = isCaretAtTheLastLine(editor);
    if (!vScrollAtBottom && caretAtTheLastLine) {
      myCancelStickToEnd = true;
    } 
  }
private void updateStickToEndState(@NotNull EditorEx editor, boolean useImmediatePosition)