Skip to content

Commit f98a8da

Browse files
committed
sourceview: Fix text-wrapping reset from commit dialog (bgo#741620)
Because we set the wrap-mode forcefully in the commit dialog's sourceview, the gsettings binding was overriding the actual set preference.
1 parent e5570ed commit f98a8da

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

data/ui/vcview.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@
277277
<property name="can_focus">True</property>
278278
<property name="shadow_type">in</property>
279279
<child>
280-
<object class="MeldSourceView" id="textview">
280+
<object class="CommitMessageSourceView" id="textview">
281281
<property name="visible">True</property>
282282
<property name="can_focus">True</property>
283283
<property name="wrap_mode">word</property>

meld/sourceview.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,14 @@ def get_y_for_line_num(self, line):
9696

9797
def get_line_num_for_y(self, y):
9898
return self.get_line_at_y(y)[0].get_line()
99+
100+
101+
class CommitMessageSourceView(GtkSource.View):
102+
103+
__gtype_name__ = "CommitMessageSourceView"
104+
105+
__gsettings_bindings__ = (
106+
('indent-width', 'tab-width'),
107+
('insert-spaces-instead-of-tabs', 'insert-spaces-instead-of-tabs'),
108+
('draw-spaces', 'draw-spaces'),
109+
)

0 commit comments

Comments
 (0)