Skip to content

Commit

Permalink
ensure C++ snippets work in R Markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinushey committed Mar 28, 2015
1 parent 6011cff commit 61542e7
Showing 1 changed file with 7 additions and 0 deletions.
Expand Up @@ -24,6 +24,8 @@
import org.rstudio.core.client.Debug;
import org.rstudio.core.client.JsArrayUtil;
import org.rstudio.core.client.StringUtil;
import org.rstudio.core.client.regex.Pattern;
import org.rstudio.studio.client.RStudioGinjector;
import org.rstudio.studio.client.common.FilePathUtils;
import org.rstudio.studio.client.server.ServerError;
import org.rstudio.studio.client.server.ServerRequestCallback;
Expand Down Expand Up @@ -313,6 +315,11 @@ private String getActiveMode()
editor_.getCursorPosition(),
getMajorMode());

// TODO: Find a way to unify 'mode names' and 'state names' we use as
// prefixes for multi-mode documents
if (mode == "r-cpp" || mode == "c" || mode == "cpp")
mode = "c_cpp";

return mode.toLowerCase();
}

Expand Down

0 comments on commit 61542e7

Please sign in to comment.