File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -397,6 +397,20 @@ export default class ASTCapabilities {
397397 this . scrollTo ( scrollInfo ) ;
398398 }
399399
400+ insertMarkdownComment ( ) {
401+ const { livelyCodeMirror : lcm , codeMirror : cm } = this . codeProvider ;
402+
403+ const before = '/*MD ## ' ;
404+ const around = 'your text' ;
405+ const after = ' MD*/' ;
406+ const l4url = 'lively4url' ;
407+ const l4urlplus = l4url + ' + ' ;
408+
409+ const selections = cm . getSelections ( ) ;
410+ cm . replaceSelections ( selections . fill ( before ) ) ;
411+ cm . replaceSelections ( selections . fill ( after ) , "start" ) ;
412+ cm . replaceSelections ( selections . fill ( around ) , "around" ) ;
413+ }
400414 braveNewWorld ( ) {
401415 const { livelyCodeMirror : lcm , codeMirror : cm } = this . codeProvider ;
402416
Original file line number Diff line number Diff line change @@ -372,6 +372,9 @@ export default class LivelyCodeMirror extends HTMLElement {
372372 "Ctrl-Alt-G Ctrl-Alt-I" : cm => this . astCapabilities ( cm ) . then ( ac => ac . generateIf ( 'then' ) ) ,
373373 "Shift-Alt-G Alt-I" : cm => this . astCapabilities ( cm ) . then ( ac => ac . generateIf ( 'else' ) ) ,
374374
375+ // #KeyboardShortcut Alt-/ insert markdown comment
376+ "Alt-/" : cm => this . astCapabilities ( cm ) . then ( ac => ac . insertMarkdownComment ( 'condition' ) ) ,
377+
375378 // #KeyboardShortcut Alt-M ast refactoring/autocomplete menu
376379 "Alt-M" : cm => {
377380 if ( this . isJavaScript ) {
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ export default class CodeTip extends Morph {
2424 }
2525
2626 this . tips = [
27- "With 'Alt-Enter ' you can access a powerful refactoring menu." ,
27+ "With 'Alt-M ' you can access a powerful refactoring menu." ,
2828 "Press 'Next Tip' to get more advice!" ,
2929 "You can get a global context menu by clicking on the background or anywhere there is not a local context menu." ,
3030 "Make your code simpler to understand with the extract method feature 'Alt+M'." ,
You can’t perform that action at this time.
0 commit comments