public class AutoHardWrapHandler
extends java.lang.Object
EditorSettings.isWrapWhenTypingReachesRightMargin(Project)
option.Modifier and Type | Field and Description |
---|---|
static Key<java.lang.Boolean> |
AUTO_WRAP_LINE_IN_PROGRESS_KEY
This key is used as a flag that indicates if
'auto wrap line on typing' activity is performed now. |
Constructor and Description |
---|
AutoHardWrapHandler() |
Modifier and Type | Method and Description |
---|---|
static AutoHardWrapHandler |
getInstance() |
void |
wrapLineIfNecessary(Editor editor,
DataContext dataContext,
long modificationStampBeforeTyping)
The user is allowed to configured IJ in a way that it automatically wraps line on right margin exceeding on typing
(check
EditorSettings.isWrapWhenTypingReachesRightMargin(Project) ). |
public static final Key<java.lang.Boolean> AUTO_WRAP_LINE_IN_PROGRESS_KEY
'auto wrap line on typing'
activity is performed now.public static AutoHardWrapHandler getInstance()
public void wrapLineIfNecessary(Editor editor, DataContext dataContext, long modificationStampBeforeTyping)
EditorSettings.isWrapWhenTypingReachesRightMargin(Project)
).
This method encapsulates that functionality, i.e. it performs the following logical actions:
- Check if IJ is configured to perform automatic line wrapping on typing. Return in case of the negative answer;
- Check if right margin is exceeded. Return in case of the negative answer;
- Perform line wrapping;
editor
- active editordataContext
- current data contextmodificationStampBeforeTyping
- document modification stamp before the current symbols typing