positron icon indicating copy to clipboard operation
positron copied to clipboard

Console "remembers" previously run unfinished code

Open kv9898 opened this issue 1 year ago • 0 comments

System details:

Windows 11

Positron and OS details:

Positron Version: 2024.10.0 (system setup) build 14 Code - OSS Version: 1.93.0 Commit: 901ab5d11d694212d32e53b97f771c5d601e428e Date: 2024-10-09T15:24:43.348Z Electron: 30.4.0 Chromium: 124.0.6367.243 Node.js: 20.15.1 V8: 12.4.254.20-electron.0 OS: Windows_NT x64 10.0.22631

Interpreter details:

R 4.4.1

Describe the issue:

After "unfinished" code (e.g. unclosed bracket) is run and cleared, later codes do not run normally as the console "remembers" the previous unfinished code.

Steps to reproduce the issue:

  1. Start an R document
  2. Enter in document
if (TRUE) {
  print("hello")
# } # deliberately left unclosed
  1. Run the code above in the document with Ctrl/Cmd+Enter
  2. Note that the code is now entered in Console.
  3. Now we realise we made a mistake → clear the console with Ctrl/Cmd+A and Backspace
  4. Fix the code:
if (TRUE) {
  print("hello")
} # now fixed

7.Rerun the code in the document with Ctrl/Cmd+Enter 8. Weird thing happens in console. The code is not run and the console "remembers" the previous code:

>if (TRUE) {
+  print("hello")
+# } # deliberately left unclosed
+
+if (TRUE) {
+  print("hello")
+}

Expected or desired behavior:

The console does not "remember" the wrong code

Were there any error messages in the UI, Output panel, or Developer Tools console?

No

kv9898 avatar Oct 12 '24 01:10 kv9898