Skip to content

Commit

Permalink
fix(editor): highlight tab characters in interactive editor
Browse files Browse the repository at this point in the history
  • Loading branch information
adi-herwana-nus authored and cysjonathan committed Jul 31, 2024
1 parent 32cbd99 commit 021438e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions client/app/lib/components/core/fields/AceEditor.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.ace_invisible {
opacity: 0;
}

.ace_invisible.ace_invisible_tab {
opacity: 1;
}
3 changes: 3 additions & 0 deletions client/app/lib/components/core/fields/EditorField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { LanguageMode } from 'types/course/assessment/question/programming';

import 'ace-builds/src-noconflict/theme-github';

import './AceEditor.css';

interface EditorProps extends ComponentProps<typeof AceEditor> {
language: LanguageMode;
value?: string;
Expand Down Expand Up @@ -52,6 +54,7 @@ const EditorField = forwardRef(
readOnly: disabled,
useWorker: false,
fontFamily: DEFAULT_FONT_FAMILY,
showInvisibles: true,
}}
/>
);
Expand Down
1 change: 1 addition & 0 deletions client/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ module.exports = {
'node_modules/react-tooltip/dist/react-tooltip.min.css',
),
resolve(__dirname, 'app/lib/components/core/fields/CKEditor.css'),
resolve(__dirname, 'app/lib/components/core/fields/AceEditor.css'),
],
},
{
Expand Down

0 comments on commit 021438e

Please sign in to comment.