![]() For example, enter Control/Ctrl Shift 1 to maximize the R script, notebook, or R Markdown file you are working in. If you prefer to only have one pane in view at a time, add Shift to any of the above commands to maximize the pane. Control/Ctrl 1: Source editor (your script).Use these shortcuts to instantly move between panes: Knowing how to toggle between panes without touching your mouse to move your cursor will save time and improve your workflow. RStudio window panes keep important information about your project accessible. Once it's found I'm confident that the fix won't be overly complex.Start learning R today with our Introduction to R course - no credit card required! SIGN UP 1. With more concrete cause and effect I can start breaking this down and finding the exact culprit. It is possible that unicode is not the only possible cause but it's the biggest clue that I have. It's some confluence of the unicode and the carriage returns that makes them overrun the buckets (which is why they weren't cleaned up). It turned out the inflection point that made it super broken was the checkmarks/unicode characters. After a lot of debug logging show that the cursor_ is identical with the feature on/off I moved to building up from a simple example. I was originally assuming there was something fundamentally wrong with how I was staying in sync with with the cursor_ that allows us to overwrite ranges for things like the carriage return. I was breaking down the installation progress update example to try to figure out exactly what was causing it to be so weird. I finally just narrowed it down this morning. Perhaps this is expected quirky functionality in RStudio but it's not what I would have expected as a user.ģ. When you select both lines and run them you get "Bye1 1\n 2", which is different output than if you sourced the full document into R. When you run that line and then 1 1 after by itself everything is fine. When running cat("\Hello\rBye") by itself you correctly get the output "Byelo". Whew, not a regression but a bug/quirk we've had for a while. Oh no, did I break something fundamental? I rushed to my laptop with 1.3 on it and tested there. I was testing what looked like a bug with the virtualconsole.js functionality running the Hello/Bye/1 1 example both as single sourced and multiple sourced lines but was worried when I saw it with the feature turned off. Sourcing one line at a time versus sourcing multiple lines at once gets different output. There is still an issue of some excess prompts related to carriage returns but they clean up with control L now and it's an improvement over what's there at the moment.Ģ. I've added cleanup functions and my own ensureStartingOnNewLine (which fixes some weird prompt stuff also) to keep these more in sync but it adds complexity I don't like. It turns out that a lot of weirdness with newlines showing up where they should/shouldn't be was because the frontend is modifying it in certain places outside of the main R session submit() functions. This is not easy and it's compounded by many moving parts on the frontend modifying the console out of the void sometimes (see ensureStartingOnNewLine()). So what we try to do with virtualconsole.js is keep it in sync with all the other moving parts (VirtualConsole, ConsoleOutputWriter, the backend R session, the C state). When it inits we move all that content over and I assumed I just had to clean some stuff up in there. It doesn't init until the first time you write to the console so, due to some race conditions, you could have some non-virtualconsole.js content in there originally. My initial approach was assuming that it was just some junk left over from the virtualconsole.js initialization. The original issue: left over junk in the console, even upon a clear. I think it'll be very good for the health of this feature to have all these fixed but it's led me down some rabbit holes.ġ. This ticket has turned into much more than it's seemed. ![]() Kevin managed to find test cases that exposed, at minimum, 3 bugs.
0 Comments
Leave a Reply. |