[meld: 6/7] Merge branch 'master' into heikkiket/meld-cherry-pick-d76eb0e0
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld: 6/7] Merge branch 'master' into heikkiket/meld-cherry-pick-d76eb0e0
- Date: Sun, 3 Nov 2019 00:57:06 +0000 (UTC)
commit 8efac9c38920237678f7fa608f35691e3abf65ea
Merge: 78db00c2 571458ba
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sun Nov 3 10:48:39 2019 +1000
Merge branch 'master' into heikkiket/meld-cherry-pick-d76eb0e0
.gitlab-ci.yml | 24 +-
.pre-commit-config.yaml | 38 +
MANIFEST.in | 5 +-
README.md | 26 +-
bin/meld | 56 +-
data/icons/COPYING | 12 -
data/icons/COPYING_CCBYSA3 | 7 -
.../HighContrast/scalable/apps/org.gnome.meld.svg | 232 --
data/icons/Makefile | 3 +-
data/icons/README | 32 +-
data/icons/emblem-meld-newer-file.png | Bin 328 -> 0 bytes
data/icons/filter-ignored-24.png | Bin 749 -> 0 bytes
data/icons/filter-modified-24.png | Bin 952 -> 0 bytes
data/icons/filter-nonvc-24.png | Bin 1048 -> 0 bytes
data/icons/filter-normal-24.png | Bin 1059 -> 0 bytes
.../hicolor/16x16/apps/meld-version-control.png | Bin 876 -> 0 bytes
data/icons/hicolor/16x16/apps/meld.xcf | Bin 3823 -> 0 bytes
data/icons/hicolor/16x16/apps/org.gnome.meld.png | Bin 799 -> 0 bytes
data/icons/hicolor/22x22/apps/meld.xcf | Bin 6846 -> 0 bytes
data/icons/hicolor/22x22/apps/org.gnome.meld.png | Bin 1366 -> 0 bytes
data/icons/hicolor/32x32/apps/org.gnome.meld.png | Bin 2344 -> 0 bytes
data/icons/hicolor/32x32/apps/org.gnome.meld.svg | 843 ------
.../hicolor/48x48/apps/meld-version-control.png | Bin 2521 -> 0 bytes
data/icons/hicolor/48x48/apps/org.gnome.meld.png | Bin 3571 -> 0 bytes
.../icons/hicolor/scalable/apps/org.gnome.meld.svg | 919 +-----
.../symbolic/apps/org.gnome.meld-symbolic.svg | 3 +
data/icons/org.gnome.meld.ico | Bin 17166 -> 17166 bytes
data/icons/vc-add-24.png | Bin 755 -> 0 bytes
data/icons/vc-checkout-24.png | Bin 749 -> 0 bytes
data/icons/vc-commit-24.png | Bin 792 -> 0 bytes
data/icons/vc-push-24.png | Bin 891 -> 0 bytes
data/icons/vc-remove-24.png | Bin 644 -> 0 bytes
data/icons/vc-resolve-24.png | Bin 736 -> 0 bytes
data/icons/vc-update-24.png | Bin 797 -> 0 bytes
meld.1 => data/meld.1 | 0
data/meld.css | 38 -
data/meson.build | 109 +
data/mime/org.gnome.meld.xml.in | 2 +-
data/org.gnome.meld.appdata.xml.in | 34 +-
data/org.gnome.meld.desktop.in | 10 +-
data/org.gnome.meld.gschema.xml | 28 +-
...meld-base.xml => meld-base.style-scheme.xml.in} | 6 +-
...meld-dark.xml => meld-dark.style-scheme.xml.in} | 6 +-
data/ui/dirdiff-ui.xml | 61 -
data/ui/filediff-ui.xml | 77 -
data/ui/meldapp-ui.xml | 72 -
data/ui/vcview-ui.xml | 78 -
dev-requirements.txt | 9 +-
gettext/its/mime.its | 6 +
gettext/its/mime.loc | 6 +
gettext/its/style-scheme.its | 6 +
gettext/its/style-scheme.loc | 6 +
help/C/buildwebhelp.py | 1 -
help/C/file-filters.page | 2 -
help/C/flattened-view.page | 2 -
help/C/keyboard-shortcuts.page | 1 -
help/LINGUAS | 6 +
help/es/es.po | 3055 +++++++++----------
help/meson.build | 23 +
maint | 65 +-
meld/accelerators.py | 53 +
meld/actiongutter.py | 401 +++
meld/build_helpers.py | 29 +-
meld/chunkmap.py | 432 +++
meld/conf.py | 6 +-
meld/const.py | 32 +-
meld/diffgrid.py | 98 +-
meld/diffmap.py | 182 --
meld/dirdiff.py | 549 ++--
meld/filediff.py | 841 ++++--
meld/filemerge.py | 46 -
meld/gutterrendererchunk.py | 236 +-
meld/iohelpers.py | 14 +-
meld/linkmap.py | 33 +-
meld/matchers/diffutil.py | 20 +-
meld/matchers/helpers.py | 1 -
meld/matchers/merge.py | 5 +-
meld/meldapp.py | 12 +-
meld/meldbuffer.py | 15 +-
meld/melddoc.py | 110 +-
meld/meldwindow.py | 456 +--
meld/menuhelpers.py | 23 +
meld/meson.build | 87 +
meld/misc.py | 113 +-
meld/newdifftab.py | 55 +-
meld/patchdialog.py | 40 +-
meld/preferences.py | 134 +-
meld/recent.py | 6 +-
meld/resources/gtk/help-overlay.ui | 78 +-
meld/resources/gtk/menus.ui | 177 +-
meld/resources/meld.css | 87 +
meld/resources/meld.gresource.xml | 10 +-
meld/resources/meson.build | 8 +
meld/resources/ui/appwindow.ui | 224 +-
meld/resources/ui/column-list.ui | 4 +-
meld/resources/ui/commit-dialog.ui | 21 +-
meld/resources/ui/dirdiff-actions.ui | 84 +
meld/resources/ui/dirdiff-menus.ui | 45 +
meld/resources/ui/dirdiff.ui | 342 +--
meld/resources/ui/filediff-actions.ui | 105 +
meld/resources/ui/filediff-menus.ui | 63 +
meld/resources/ui/filediff.ui | 757 ++---
meld/resources/ui/filter-list.ui | 13 +-
meld/resources/ui/findbar.ui | 212 +-
meld/resources/ui/new-diff-tab.ui | 821 +++--
meld/resources/ui/notebook-label.ui | 11 +-
meld/resources/ui/preferences.ui | 184 +-
meld/resources/ui/recent-selector.ui | 56 +
meld/resources/ui/vcview-menus.ui | 46 +
meld/resources/ui/vcview.ui | 242 +-
meld/settings.py | 20 +-
meld/sourceview.py | 206 +-
meld/style.py | 122 +
meld/tree.py | 32 +-
meld/ui/_gtktemplate.py | 234 --
meld/ui/bufferselectors.py | 26 +-
meld/ui/catalog.xml | 6 +-
meld/ui/cellrenderers.py | 18 +-
meld/ui/emblemcellrenderer.py | 5 +-
meld/ui/filechooser.py | 33 +-
meld/ui/findbar.py | 145 +-
meld/ui/gladesupport.py | 4 +-
meld/ui/historyentry.py | 5 +-
meld/ui/notebook.py | 7 +-
meld/ui/notebooklabel.py | 26 +-
meld/ui/recentselector.py | 92 +
meld/ui/statusbar.py | 28 +-
meld/ui/util.py | 24 +-
meld/ui/vcdialogs.py | 33 +-
meld/undo.py | 1 -
meld/vc/__init__.py | 22 +-
meld/vc/_vc.py | 7 +-
meld/vc/cvs.py | 159 +
meld/vc/git.py | 1 -
meld/vc/svn.py | 2 +-
meld/vcview.py | 289 +-
meld/windowstate.py | 1 -
meson.build | 47 +
meson_post_install.py | 14 +
po/POTFILES.in | 60 +-
po/cs.po | 1522 +++++-----
po/da.po | 2029 ++++++-------
po/dz.po | 1 -
po/en_CA.po | 4 +-
po/es.po | 2585 ++++++++--------
po/eu.po | 3142 +++++++++++---------
po/fr.po | 4 +-
po/gl.po | 2075 ++++++-------
po/hu.po | 2390 +++++++--------
po/id.po | 1998 +++++++------
po/it.po | 2356 +++++++--------
po/ja.po | 1849 ++++++------
po/ko.po | 4 +-
po/meson.build | 1 +
po/ne.po | 1 -
po/pa.po | 1 -
po/pl.po | 1516 +++++-----
po/pt_BR.po | 2576 ++++++++--------
po/ro.po | 698 +++--
po/sl.po | 2051 ++++++-------
po/tr.po | 2594 ++++++++--------
po/uk.po | 1 -
setup.cfg | 20 +-
setup.py | 2 +-
setup_win32.py | 16 +-
test/conftest.py | 4 +-
test/test_buffer_lines.py | 15 +-
test/test_chunk_actions.py | 9 +-
test/test_filediff.py | 4 +-
test/test_gutterrendererchunk.py | 83 +-
test/test_matchers.py | 16 +-
test/test_misc.py | 1 +
172 files changed, 22511 insertions(+), 22254 deletions(-)
---
diff --cc meld/filediff.py
index 4ac84fc9,9a08ed93..40aac6c6
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@@ -16,15 -16,11 +16,11 @@@
import copy
import functools
+ import logging
import math
- from typing import Optional
-from typing import Type
++from typing import Optional, Type
- from gi.repository import Gdk
- from gi.repository import Gio
- from gi.repository import GLib
- from gi.repository import GObject
- from gi.repository import Gtk
- from gi.repository import GtkSource
+ from gi.repository import Gdk, Gio, GLib, GObject, Gtk, GtkSource
# TODO: Don't from-import whole modules
from meld import misc
@@@ -598,46 -753,21 +753,51 @@@ class FileDiff(Gtk.VBox, MeldDoc)
mark0, mark1, 'focus-highlight', 400000, starting_alpha=0.3,
anim_type=TextviewLineAnimationType.stroke)
- @Template.Callback()
+ @Gtk.Template.Callback()
def on_linkmap_scroll_event(self, linkmap, event):
- self.next_diff(event.direction)
+ self.next_diff(event.direction, use_viewport=True)
+
+ def _is_chunk_in_area(
+ self, chunk_id: Optional[int], pane: int, area: Gdk.Rectangle):
+
+ if chunk_id is None:
+ return False
+
+ chunk = self.linediffer.get_chunk(chunk_id, pane)
+ target_iter = self.textbuffer[pane].get_iter_at_line(chunk.start_a)
+ target_y, _height = self.textview[pane].get_line_yrange(target_iter)
+ return area.y <= target_y <= area.y + area.height
+
+ def next_diff(self, direction, centered=False, use_viewport=False):
+ # use_viewport: seek next and previous diffes based on where
+ # the user is currently scrolling at.
+ scroll_down = direction == Gdk.ScrollDirection.DOWN
+ target = self.cursor.next if scroll_down else self.cursor.prev
+
+ if use_viewport:
+ pane = self.cursor.pane
+ text_area = self.textview[pane].get_visible_rect()
+
+ # Only do viewport-relative calculations if the chunk we'd
+ # otherwise scroll to is *not* on screen. This avoids 3-way
+ # comparison cases where scrolling won't go past a chunk
+ # because the scroll doesn't go past 50% of the screen.
+ if not self._is_chunk_in_area(target, pane, text_area):
+ halfscreen = text_area.y + text_area.height / 2
+ halfline = self.textview[pane].get_line_at_y(
+ halfscreen).target_iter.get_line()
+
+ _, prev, next_ = self.linediffer.locate_chunk(1, halfline)
+ target = next_ if scroll_down else prev
- def next_diff(self, direction, centered=False):
- target = (self.cursor.next if direction == Gdk.ScrollDirection.DOWN
- else self.cursor.prev)
self.go_to_chunk(target, centered=centered)
- @Template.Callback()
+ def action_previous_change(self, *args):
+ self.next_diff(Gdk.ScrollDirection.UP)
+
+ def action_next_change(self, *args):
+ self.next_diff(Gdk.ScrollDirection.DOWN)
+
def action_previous_conflict(self, *args):
self.go_to_chunk(self.cursor.prev_conflict, self.cursor.pane)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]