Modify "Insert Section" result


The "Insert Section" command (and shortcut) is nice, but it outputs a line of length 76. I have my margin column at 80 characters. Is there a way to modify the output of the "Insert Section" command to match the "Margin column" value (or be some other fixed value)? Maybe it defaults to 76 characters and can be overridden by the "Margin column" value if "Show margin" is selected.

1 Like


Strange that you're getting 76 with margin column at 80, since it looks like it's set up to be width of print margin - 5 (maybe that doesn't account for the #, I didn't read through all of the code:

1 Like


Ah, it is doing a line length of 75; I had mixed that up with cursor position.

It'd be nice if it were possible to dictate how much it truncates. I'd personally like to see "- 0" instead of "- 5" in that line length calculation.

1 Like


You can certainly submit a feature request on the IDE GitHub repo (just double check to make sure one doesn't already exist). Here's the RStudio IDE Guide: Writing Good Feature Requests.

1 Like