Skip to content

Commit

Permalink
Added foldCheck skipping (#1007)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jugen authored Mar 15, 2021
1 parent 32b7fea commit f4b72cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1550,11 +1550,14 @@ protected void fold( int startPos, int endPos, UnaryOperator<PS> styleMixin )
replace( startPos, endPos, subDoc );
recreateParagraphGraphic( offsetToPosition( startPos, Bias.Backward ).getMajor() );
moveTo( startPos );
foldCheck = true;
}

protected boolean foldCheck = false;

private void skipOverFoldedParagraphs( ObservableValue<? extends Integer> ob, Integer prevParagraph, Integer newParagraph )
{
if ( getCell( newParagraph ).isFolded() )
if ( foldCheck && getCell( newParagraph ).isFolded() )
{
// Prevent Ctrl+A and Ctrl+End breaking when the last paragraph is folded
// github.com/FXMisc/RichTextFX/pull/965#issuecomment-706268116
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
}

/* For folding/hiding paragraphs. It's applied to TextFlow. */
.collapse { visibility: collapse; }
.styled-text-area .collapse { visibility: collapse; }

0 comments on commit f4b72cb

Please sign in to comment.