GoAlexander / harbour-editor

Functional rich editor for Sailfish OS.
GNU General Public License v3.0
17 stars 16 forks source link

Feature request: Option to autosave text files directly to original $FILE #72

Open Self-Perfection opened 7 years ago

Self-Perfection commented 7 years ago

In my use case it is more convenient to have Editor. autosave modified file directly to $FILE and not to extra file $FILE~. I'd like to have an option to switch to this behaviour instead of default one.

GoAlexander commented 7 years ago

I agree with this idea. I will try to implement it when I will have free time :)

GoAlexander commented 7 years ago

Feature request: Option to autosave text files directly original $FILE #72

Olf0 commented 7 years ago

Mmmh, such an option is a little bit dangerous for an average user. But when defaulting to "off", it is one's own responsibility to enable it.

Consequently no backup file (\<filename>~) should be created or written to, when this option is active.

GoAlexander commented 7 years ago

@Olf0 I want to implement this behavior only as option. Default behavior will be as by now.

Self-Perfection commented 7 years ago

On the contrary I'd like to note that "Quick note" feature almost covers what I need. If Editor. gets a way to start directly in "Quick note" mode (see #87) I'll drop my request for this optional switch for autosave feature.

Olf0 commented 7 years ago

@GoAlexander

I want to implement this behavior only as option. Default behavior will be as by now.

Understood (as I wrote), but the intended core message in my comment above was originally the second paragraph.

But now (in the light of @Self-Perfection's last message, directly above) I would like to emphasise, that IMO an editor should never automatically save changes to the original file. This just calls for mishaps. Saving to the original file (and any other one, except for backup files with a "~" appended) should always be done explicitly (i.e. on user request). But this is just my advice; Editor. is your baby and hence feel free to decide as you like.

GoAlexander commented 6 years ago

@Self-Perfection It is not exactly want you want in this PR but I pushed commit which has new option to disable autosave: 92a888fca23ddb10305d416f3615e1c779bd3274 Are you satisfied with it? Can I close this PR?

Same in context of #88

Self-Perfection commented 6 years ago

@GoAlexander my goal is to use Editor. for quick storing of notes in txt file. For now shortest path for is following

  1. Tap on special icon on the app list to to open notes file (I have created custom ~/.local/share/applications/note.desktop launcher with Exec=harbour-editor /home/nemo/note.txt)
  2. Edit note
  3. Tap "save"
  4. Close app

I'd like to have it a bit simpler. So how can I get rid of requirement to tap "save"?

I can't rely on autosave feature. With autosave modified note would end up in /home/nemo/note.txt~ - that is not where I need it to be. So I've asked for an option to save directly to original file (this issue).

But there is "quick note" option now. Maybe it can do the trick? Nope, with this option the sequence is even longer:

  1. Launch Editor.
  2. Pull to get access for menu
  3. Tap on "quick note" command
  4. Edit note
  5. Close app

If only I could get to "quick note" mode directly, just by tapping on icon in app list... That is the goal of #87

As you can see disabling autosave does not help me for my task. Though it is ineed helpful as it let me to avoid #88