Notification when both panes are equal
Posted: 2023-03-15, 04:18 UTC
[Cross-post from https://www.ghisler.ch/board/viewtopic.php?p=428215]
I'd like to get notification when both panes are pointing to the same directory.
My first though was: a special background colour when that situation is encountered. EG, turn the background colour yellow when both panes are at the same directory.
Another approach might be a warn-on-delete-attempt when the path for both panes is the same, though that wouldn't capture some situations (eg user thinks panes are pointing to different dirs, and opens a file for editing, thinking the 'other' file will be unmodified).
The reason is: I recently deleted a file by mistake; I was moving many files around to a new location, and at one point, I deleted a file, not realizing my 'source' directory and 'destination' directory were the same. I had thought I was only deleting the file from the source. It wasn't a big problem, but I'd like to avoid it in the future.
The post linked above had a couple of helpful replies that suggest some ways to accomplish the warn-on-delete attempt, though imperfectly (virtual/symlinked folders having different paths but the same physical location, for example).
If there's some way of accomplishing the first approach through a plugin [or other] API, I'd be interested in that, as well.
Thanks!
I'd like to get notification when both panes are pointing to the same directory.
My first though was: a special background colour when that situation is encountered. EG, turn the background colour yellow when both panes are at the same directory.
Another approach might be a warn-on-delete-attempt when the path for both panes is the same, though that wouldn't capture some situations (eg user thinks panes are pointing to different dirs, and opens a file for editing, thinking the 'other' file will be unmodified).
The reason is: I recently deleted a file by mistake; I was moving many files around to a new location, and at one point, I deleted a file, not realizing my 'source' directory and 'destination' directory were the same. I had thought I was only deleting the file from the source. It wasn't a big problem, but I'd like to avoid it in the future.
The post linked above had a couple of helpful replies that suggest some ways to accomplish the warn-on-delete attempt, though imperfectly (virtual/symlinked folders having different paths but the same physical location, for example).
If there's some way of accomplishing the first approach through a plugin [or other] API, I'd be interested in that, as well.
Thanks!