Skip to content

Commit

Permalink
Change code wrapping to scrollbar (#242)
Browse files Browse the repository at this point in the history
Co-authored-by: Lois Wells <lois.wells@raspberrypi.org>
Co-authored-by: Steve Gilroy <stephen.gilroy@raspberrypi.org>
  • Loading branch information
3 people authored Oct 25, 2022
1 parent 6fcd749 commit 0d6b0dc
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 14 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Changed

- Switch wrapping in the editor to horizontal scrolling for long lines (#242)

## [0.7.0]

### Changed
Expand Down
18 changes: 10 additions & 8 deletions src/components/Editor/EditorPanel/EditorPanel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,25 @@
display: flex;
flex-flow: column;
flex: 1;
overflow: hidden;

.cm-editor {
flex: 1;
overflow: hidden;

&:focus {
outline: none;
}

.cm-content {
white-space: pre-wrap;
overflow-wrap: anywhere;
flex: 1;
padding-top: var(--spacing-1);
}
.cm-scroller {
overflow: auto;
overscroll-behavior-x: none;

.cm-line {
padding-right: var(--spacing-1)
.cm-content {
flex: 1;
padding-top: var(--spacing-1);
margin-right: var(--spacing-1);
}
}
}
}
8 changes: 8 additions & 0 deletions src/components/Editor/Project/Project.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,19 @@
flex-flow: column;
width: 42%;
box-sizing: border-box;

.react-tabs__tab-panel--selected {
overflow-y: hidden;
}
}

.proj-runner-container {
display: flex;
width: 42%;

.react-tabs__tab-panel--selected {
overflow-y: auto;
}
}

&--wc {
Expand Down
3 changes: 1 addition & 2 deletions src/components/Editor/editorDarkTheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import '@rpf/sauce/scss/properties/_font-size.scss';
import '@rpf/sauce/scss/properties/_line-height.scss';

export const editorDarkTheme = EditorView.theme({
".cm-scroller": {overflow: "auto"},
".cm-gutters": {
"background-color": "inherit",
"background-color": "#2E3038",
"border": "none"
},
".cm-activeLine": {
Expand Down
1 change: 0 additions & 1 deletion src/components/Editor/editorLightTheme.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { EditorView } from '@codemirror/view';

export const editorLightTheme = EditorView.theme({
".cm-scroller": {overflow: "auto"},
".cm-activeLine": {
"background-color": "inherit",
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/EmbeddedViewer/EmbeddedViewer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

.visual-output {
box-sizing: border-box;
overflow: scroll;
overflow: auto;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Menus/FileMenu/FileMenu.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import '../../../colours.scss';

.file-menu {
overflow-y: scroll;
overflow-y: auto;
width: 16%;

summary {
Expand Down
1 change: 0 additions & 1 deletion src/tabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
flex: 1;
display: flex;
flex-flow: column;
overflow-y: scroll;
}
}

Expand Down

0 comments on commit 0d6b0dc

Please sign in to comment.