Skip to content
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

Change key bindings for folding in PGCodeMirror. #2594

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 4 additions & 6 deletions htdocs/js/PGCodeMirror/pgeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,10 @@
lineWrapping: true,
extraKeys: {
Tab: (cm) => cm.execCommand('insertSoftTab'),
'Shift-Ctrl-F': (cm) => cm.foldCode(cm.getCursor(), { scanUp: true }),
'Shift-Cmd-F': (cm) => cm.foldCode(cm.getCursor(), { scanUp: true }),
'Shift-Ctrl-A': (cm) => CodeMirror.commands.foldAll(cm),
'Shift-Cmd-A': (cm) => CodeMirror.commands.foldAll(cm),
'Shift-Ctrl-G': (cm) => CodeMirror.commands.unfoldAll(cm),
'Shift-Cmd-G': (cm) => CodeMirror.commands.unfoldAll(cm)
'Shift-Ctrl-[': (cm) => cm.foldCode(cm.getCursor(), { scanUp: true }),
'Cmd-Alt-[': (cm) => cm.foldCode(cm.getCursor(), { scanUp: true }),
'Ctrl-Alt-[': (cm) => CodeMirror.commands.foldAll(cm),
'Ctrl-Alt-]': (cm) => CodeMirror.commands.unfoldAll(cm)
},
highlightSelectionMatches: { annotateScrollbar: true },
matchBrackets: true,
Expand Down
4 changes: 2 additions & 2 deletions templates/HelpFiles/InstructorPGProblemEditor.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@
<dd class="list-group-item">
<%= maketext('This is where you edit the text of the problem template. Type Ctrl-Enter while this '
. 'window has focus to re-render the problem. Code folding is enabled either by clicking on '
. 'the triangles in the gutter next to line numbers or using the shortcut Shift-Ctrl-F. Folding '
. 'all regions can be accomplished with Shift-Ctrl-A and unfold all regions with Shift-Ctrl-G. '
. 'the triangles in the gutter next to line numbers or using the shortcut Shift-Ctrl-~[. Folding '
. 'all regions can be accomplished with Ctrl-Alt-~[ and unfold all regions with Ctrl-Alt-~]. '
. 'Comments can be toggled with Ctrl-/.') =%>
</dd>
<dt><%= maketext('Text Editor Options') %></dt>
Expand Down