Add toggle comment functionality to scripter - fix null line bug
AbandonedPublic

Authored by brendanbd on Dec 28 2017, 9:27 PM.

Details

Reviewers
None
Group Reviewers
Krita
Maniphest Tasks
T7627: Generic Scripter UI improvements task
Summary

Toggle comment functionality introduced in https://phabricator.kde.org/D9430
fails when one of the selected lines is empty. Line count ends up off by one. The null line is not commented, and an extra line beyond the selection is toggled. This patch tests for a null line and comments it if found

This diff also removes some unused imports and a couple of lines of unused code.

This diff assumes the following diffs have been applied:
https://phabricator.kde.org/D9419
https://phabricator.kde.org/D9430
https://phabricator.kde.org/D9445

Test Plan

In code:


#NameError: name 'a' is not defined

#In file: /home/bb/krita/phabricator/test_scripter.py
#In function: <module> at line: 54. Line with error:
#a.a

Move cursor to line 2, press ctrl-M
Select lines 1-3 (ie a selection that includes a null line), press ctrl-M

Diff Detail

Repository
R37 Krita
Lint
Lint Skipped
Unit
Unit Tests Skipped
brendanbd created this revision.Dec 28 2017, 9:27 PM
Restricted Application added a subscriber: woltherav. ยท View Herald TranscriptDec 28 2017, 9:27 PM
brendanbd edited the summary of this revision. (Show Details)Dec 28 2017, 9:29 PM

There seems to be another bug when commenting the first line of a script. I need to fix.

rempt added a subscriber: rempt.Jan 23 2018, 9:31 AM

Okay, let's leave this one to the last then?

Please push your other patches once you've got commit access. Add

Differential Revision: https://phabricator.kde.org/DNNNN

To the commit message, then the relevant diffs will be closed.