Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,25 @@ const StyledWrapper = styled.div`
box-sizing: border-box;

> div:not(.drag-handle) {
height: 33px;
max-height: 33px;
height: 1.5em;
max-height: 1.5em;
overflow: hidden;
align-items: flex-start;
}

> div:not(.drag-handle) > * {
min-height: 0;
}

&:focus-within > div:not(.drag-handle) {
height: auto;
max-height: none;
overflow: visible;
align-items: center;
}

> div:not(.drag-handle) > * {
min-height: 0;
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

/* Handle CodeMirror editors overflow */
Expand All @@ -122,15 +138,33 @@ const StyledWrapper = styled.div`
max-width: 100%;
}

.cm-line {
.cm-line {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}

&:focus-within {
height: auto;
max-height: none;
overflow: visible;
white-space: normal;
text-overflow: clip;
}

&:focus-within > div:not(.drag-handle) {
height: auto;
max-height: none;
overflow: visible;
}

&:focus-within .single-line-editor,
&:focus-within .single-line-editor .CodeMirror {
height: auto !important;
}
}
}
}

&.has-checkbox tbody td:nth-child(1) {
width: 25px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ const StyledWrapper = styled.div`
}
}

.CodeMirror {
.CodeMirror {
background: transparent;
height: fit-content;
font-size: ${(props) => props.theme.font.size.base};
line-height: 30px;
line-height: 1.5;
display: flex;
flex-direction: column;
max-height: 200px;
Expand All @@ -46,8 +46,6 @@ const StyledWrapper = styled.div`
}

.CodeMirror-cursor {
height: 20px !important;
margin-top: 5px !important;
border-left: 1px solid ${(props) => props.theme.text} !important;
}

Expand Down
8 changes: 4 additions & 4 deletions packages/bruno-app/src/components/MultiLineEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ class MultiLineEditor extends Component {
* in request tabs. Falling through with CodeMirror.Pass when onRun is absent
* would re-introduce the newline in collection/folder-level editors.
*/
const runShortcut = () => {};
const runShortcut = () => { };

this.editor = CodeMirror(this.editorRef.current, {
lineWrapping: false,
lineWrapping: true,
lineNumbers: false,
theme: this.props.theme === 'dark' ? 'monokai' : 'default',
placeholder: this.props.placeholder,
Expand All @@ -55,8 +55,8 @@ class MultiLineEditor extends Component {
readOnly: this.props.readOnly,
tabindex: 0,
extraKeys: {
'Cmd-F': () => {},
'Ctrl-F': () => {},
'Cmd-F': () => { },
'Ctrl-F': () => { },
'Cmd-Enter': runShortcut,
'Ctrl-Enter': runShortcut,
// Tabbing disabled to make tabindex work
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const StyledWrapper = styled.div`
background: transparent;
height: ${(props) => (props.$isCompact ? '1.375rem' : '2.125rem')};
font-size: ${(props) => props.theme.font.size.base};
line-height: ${(props) => (props.$isCompact ? '1.375rem' : '1.875rem')};
line-height: 1.5;
overflow: hidden;

.CodeMirror-scroll {
Expand All @@ -40,8 +40,6 @@ const StyledWrapper = styled.div`
}

.CodeMirror-cursor {
height: ${(props) => (props.$isCompact ? '0.875rem' : '1.25rem')} !important;
margin-top: ${(props) => (props.$isCompact ? '0.25rem' : '0.3125rem')} !important;
border-left: 1px solid ${(props) => props.theme.text} !important;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class SingleLineEditor extends Component {

this.editor = CodeMirror(this.editorRef.current, {
placeholder: this.props.placeholder ?? '',
lineWrapping: false,
lineWrapping: true,
lineNumbers: false,
theme: this.props.theme === 'dark' ? 'monokai' : 'default',
mode: 'brunovariables',
Expand Down