FWDekker / intellij-randomness

IntelliJ plugin for inserting random numbers, UUIDs, names, IP addresses, and much more
https://plugins.jetbrains.com/plugin/9836-randomness
MIT License
45 stars 7 forks source link

Attempt to modify read-only document #491

Closed FWDekker closed 10 months ago

FWDekker commented 10 months ago
  1. Open a read-only file. (Or open a file and make it read-only using the "Make File Read-Only" action.)
  2. Use Randomness to insert generated data.

A com.intellij.openapi.editor.ReadOnlyModificationException with message Attempt to modify read-only document is thrown, resulting from com.fwdekker.randomness.InsertAction.actionPerformed$lambda$2(InsertAction.kt:98). Clearly, Randomness should check for write permissions before actually trying to insert the data.