https://bugs.kde.org/show_bug.cgi?id=387884

            Bug ID: 387884
           Summary: Scripter does not run edits unless saved
           Product: krita
           Version: 4.0 pre-alpha
          Platform: Other
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: Scripting
          Assignee: krita-bugs-n...@kde.org
          Reporter: bunf2...@apps.opensourcelaw.biz
  Target Milestone: ---

If a scripter script has been saved, using the Run action causes scripter to
load and run the script from its associated file - even if there are unsaved
changes in the script window. 

To reproduce:
start scripter
file->new script 
print("hello")
file-> save (choose filename and save)
press Run/Ctrl-R:

======================================
hello

add to edit window:
print("world")
press Run/Ctrl-R:

======================================
hello


That is, "world" is not printed, despite being in the edit window. This is
because saving the document sets _activeDocument flag and that causes the
script to load directly from the file. 

There are different approaches to solving this
* add a dirty flag to the edit box and check that, put a dialog up to query
saving before running - or visual indicator that script has been changed or 
toolbar warning that running script from file
* automatically save edit window before running (or have this as an option in
settings)
* have separate actions save+run (... from the file) and run (...from the
editor window)
* have separate actions run from file, run from editor (manual saving)
* have a "run-from-file" mode which doesn't display the edit window - or makes
it read only?
* run only script in window
* some combination

I personally would like to be able to run scripts directly from the file - so
that I can use a different editor.

Wanted feedback on UI before diving into patching.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to