-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow users to toggle word wrapping on the doc editor #1454
Allow users to toggle word wrapping on the doc editor #1454
Conversation
Looks great! |
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import Components from '../../../components/react-components'; | ||
// import Constants from '../constants'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// import Constants from '../constants'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
@@ -39,6 +40,7 @@ export class StringEditModal extends React.Component { | |||
this.editor = ace.edit(dom_node); | |||
this.editor.setShowPrintMargin(false); | |||
this.editor.setOption('highlightActiveLine', true); | |||
this.editor.setOption('wrap', !!this.props.wordWrapEnabled); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is on purpose to turn falsy/truthy values to false
/ true
@@ -39,6 +40,7 @@ export class StringEditModal extends React.Component { | |||
this.editor = ace.edit(dom_node); | |||
this.editor.setShowPrintMargin(false); | |||
this.editor.setOption('highlightActiveLine', true); | |||
this.editor.setOption('wrap', !!this.props.wordWrapEnabled); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is on purpose to turn falsy/truthy values to false
/ true
Overview
Allow users to toggle word wrapping on the doc editor, which prevents horizontal scrolling on long lines.
Word wrap OFF
![image](https://private-user-images.githubusercontent.com/30349380/339070214-955e16ac-52d4-4445-b397-c00e7c9f3ad6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjY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tei1EYXRlPTIwMjQwOTEyVDA3NDg0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU4OWE5YzIzOTI3ZmI2YmQ0YTU2NDk0OWUzZGRjZDYwMjRhY2IwZmNhOTRiOWExYjNhODM5MjNkOTI0MjVjM2MmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.0qWBFI296M5wWoCiUb0cXuvQMUyfnNijAzgg7n8Pjnc)
Testing recommendations
GitHub issue number
n/a
Related Pull Requests
n/a
Checklist