Skip to content

Commit

Permalink
automatically complete R code chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire committed Nov 21, 2012
1 parent fb9b241 commit 0788218
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/gwt/acesupport/acemode/c_cpp.js
Expand Up @@ -163,6 +163,12 @@ oop.inherits(Mode, TextMode);
if (match && editor.getSelectionRange().start.column >= match[2].length) {
return {text: "\n" + match[1]};
}
// If newline to start and embedded R chunk complete the chunk
match = /^((\s*\/\*{3,}\s*[Rr])\s*)/.exec(session.doc.getLine(pos.row));
if (match && editor.getSelectionRange().start.column >= match[2].length) {
return {text: "\n\n*/\n",
selection: [1,0,1,0]};
}
}
return false;
};
Expand Down

0 comments on commit 0788218

Please sign in to comment.