positron
positron copied to clipboard
Text / code block formatting issue for saved files
Positron Version:
Positron Version: 2024.07.0 (system setup) build 2024.07.0-15 Code - OSS Version: 1.90.0 Commit: d8da3ec9581aa7bcb9726babedacff4e3d528503 Date: 2024-07-05T03:18:37.706Z Electron: 29.4.0 Chromium: 122.0.6261.156 Node.js: 20.9.0 V8: 12.2.281.27-electron.0 OS: Windows_NT x64 10.0.22631
Steps to reproduce the issue:
- Create two files. One is saved to disk, one file is not yet saved.
- You have code with indention. If you copy the code and paste it elsewhere, indention is removed for the file that has been saved (unexpected behaviour), but not for the new file (expected behaviour).
- Similar, if you paste text into an existing line, a line-break is inserted for the saved file (unexpected behaviour) but not for the new file (expected behaviour)
Were there any error messages in the output or Developer Tools console?
No.
See videos here: first file is saved to disk, indention is removed or a line-break inserted. Second file in the videos is the new file, where we find the expected behaviour.
https://github.com/posit-dev/positron/assets/26301769/88ba0238-9d5a-4b74-bdb4-95ffed2eec78
https://github.com/posit-dev/positron/assets/26301769/157888af-cdc3-4e40-9072-73113009ca3c
We have initial formatting set up for R in Positron using styler plus an indent-only formatter (see https://github.com/posit-dev/ark/pull/329 for details) but in the longer term plan for a full formatter for R, as outlined in https://github.com/posit-dev/positron/issues/2251.
But what I think is strange is that formatting works for new files, but indention is removed / formatting broken for saved files. I'm not complaining about yet missing formatting features.
We think this is a styler related issue, and the formatting world for R in Positron is about to change enough that we feel we can close this one, but thanks for reporting!