dendronhq / dendron

The personal knowledge management (PKM) tool that grows as you do!
https://wiki.dendron.so
Apache License 2.0
6.52k stars 247 forks source link

Creating a note from a selection does not take into account the read-only workspace settings #3955

Open uRohan opened 8 months ago

uRohan commented 8 months ago

Please select the area your bug applies to. (Multiple selections are Possible. You can leave blank if you're not sure.)

Describe the bug

When creating a note from selection, Dendron fails to respect the read-only mode for files within a workspace. You can read more about read-only mode in VS Code here and here.

To Reproduce

Steps to reproduce the behavior:

  1. Create a new note (e.g., food-calorie-list.apple.md).
  2. Configure the 'files.readonlyInclude' setting in your dendron.code-workspace file: "files.readonlyInclude": {"food-calorie-list.apple.md": true,}
  3. Open a read-only file/note and select a piece of text.
  4. Use Dendron Lookup and choose the option 'Create New'.
  5. Observe that the selected text fragment has been removed from the file/note (food-calorie-list.apple.md) in the read-only mode and was paste into the new note (i.e. the read-only file has been modified).

Expected behavior

Dendron is expected not to modify files marked as read-only in the dendron.workspace file.

Screenshots

If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information)

Additional context

Add any other context about the problem here.

Dendron Log file

Please attach the output of > Dendron:Dev: Open Logs here N/A