Merge lp:~davidmhewitt/scratch/fix-1303562-draw-selected-spaces into lp:~elementary-apps/scratch/scratch
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | David Hewitt | ||||
Approved revision: | 1845 | ||||
Merged at revision: | 1841 | ||||
Proposed branch: | lp:~davidmhewitt/scratch/fix-1303562-draw-selected-spaces | ||||
Merge into: | lp:~elementary-apps/scratch/scratch | ||||
Diff against target: |
338 lines (+235/-7) 6 files modified
schemas/org.pantheon.scratch.gschema.xml (+7/-2) src/CMakeLists.txt (+1/-0) src/Dialogs/PreferencesDialog.vala (+6/-3) src/DrawSpacesUtils.vala (+202/-0) src/Services/Settings.vala (+7/-1) src/Widgets/SourceView.vala (+12/-1) |
||||
To merge this branch: | bzr merge lp:~davidmhewitt/scratch/fix-1303562-draw-selected-spaces | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jeremy Wootten | code, function | Approve | |
Review via email: mp+319370@code.launchpad.net |
Commit message
Add setting and functionality to draw spaces only for selected text.
Description of the change
Currently, in the preferences, you have the option to turn "draw spaces" on or off. This branch adds a third option where spaces are drawn only within the selected region. This is useful for seeing if there is a discrepancy between tabs or spaces in a particular part of a file.
The code is ported from Gtksourceview to Vala so spaces are drawn in exactly the same way, using the same algorithm, just in a more controlled manner between the selection start and end points. It looks as though it may be possible to do this more easily without porting too much code after Gtksourceview-3.20, but this solution will continue to work too.
I think it's better to use an enum in the gsettings instead of comparing strings