Commit graph

103 commits

Author SHA1 Message Date
leo
104a3f0bbf
code_style: run dotnet format
Signed-off-by: leo <longshuang@msn.cn>
2025-04-17 16:35:18 +08:00
leo
8b39df32cc
feature: git command logs
Signed-off-by: leo <longshuang@msn.cn>
2025-04-17 13:23:56 +08:00
leo
db46de0261
enhance: append character U+26D4 to line when \ No newline at end of file is found in git diff output (#1197)
Signed-off-by: leo <longshuang@msn.cn>
2025-04-16 11:41:40 +08:00
leo
e89dbd8f43
code_review: PR #1177
- use `Command.ReadToEnd` instead of `Command.Exec` to avoid git trims line endings.
- use `StringBuilder.Append('\n')` instead of `StringBuilder.AppendLine()` to restore original line endings (we split the original diff output by `\n` not `\r')
- there's no need to show file content (the `StreamReader.ReadLine()` will trim line endings)

Signed-off-by: leo <longshuang@msn.cn>
2025-04-14 16:06:52 +08:00
Massimo
81820e7034
refactor: improve diff handling for EOL changes and enhance text diff… (#1177)
* refactor: improve diff handling for EOL changes and enhance text diff display

- Updated `Diff.cs` to streamline whitespace handling in diff arguments.
- Enhanced `DiffContext.cs` to check for EOL changes when old and new hashes differ, creating a text diff if necessary.
- Added support for showing end-of-line symbols in `TextDiffView.axaml.cs` options.

* localization: update translations to include EOF handling in ignore whitespace messages

- Modified the ignore whitespace text in multiple language files to specify that EOF changes are also ignored.
- Ensured consistency across all localization files for the patch application feature.

* revert: Typo in DiffResult comment

* revert: update diff arguments to ignore CR at EOL in whitespace handling (like before changes)

* revert: update translations to remove EOF references in Text.Apply.IgnoreWS and fixed typo in Text.Diff.IgnoreWhitespace (EOF => EOL)

---------

Co-authored-by: mpagani <massimo.pagani@unitec-group.com>
2025-04-14 15:18:45 +08:00
leo
d335cac167
enhance: only raise BlockNavigationChangedEvent when UseBlockNavigation enabled
Signed-off-by: leo <longshuang@msn.cn>
2025-03-21 18:00:46 +08:00
leo
9590f96a44
enhance: clear highlight chunk while scrolling out of TextArea.TextView
Signed-off-by: leo <longshuang@msn.cn>
2025-03-21 17:46:11 +08:00
leo
03f49ccff0
refactor: text diff view block navigation
Signed-off-by: leo <longshuang@msn.cn>
2025-03-21 17:35:59 +08:00
leo
8c1e1a3e6a
fix: text diff view scrolling issue introduced by AvaloniaEdit 11.2.0 (commit 7caa03a09b)
- `SyncScrollOffset` does not update in `side-by-side` mode while scrolling
- Highlighted chunk is not cleared when scroll by drag scrollbar

Signed-off-by: leo <longshuang@msn.cn>
2025-03-21 10:09:43 +08:00
GadflyFang
269903503f
feat: Add commit Tooltip in Blame (#1055)
Fixes #993
2025-03-05 09:36:32 +08:00
leo
2137ad9ec9
enhance: allow to configure editor tab width in preferences window (#1048)
Signed-off-by: leo <longshuang@msn.cn>
2025-03-04 17:26:27 +08:00
leo
11af5d9b29
code_style: use ?: operator instead of if ... else statement
Signed-off-by: leo <longshuang@msn.cn>
2025-03-04 16:42:32 +08:00
leo
96538b9a62
fix: there's an extra line-ending while copy multiple lines from text diff view (#1049)
Signed-off-by: leo <longshuang@msn.cn>
2025-03-04 16:26:14 +08:00
leo
35ee4a47db
fix: the last selected line is missing while trying to copy multiple lines in text diff view (#1044)
Signed-off-by: leo <longshuang@msn.cn>
2025-03-03 15:39:59 +08:00
leo
c6747f72f9
feature: auto-select first change in commit details panel and revision/branch compare panel (#1019)
Signed-off-by: leo <longshuang@msn.cn>
2025-02-25 10:53:42 +08:00
Göran W
fa4caa2186
enhance: add first/last buttons for block-nav, no wrapping (#1015) (#1016)
Added 2 new buttons (only visible in block-nav mode), with new icons and new (en_US) strings (First/Last Difference).
Implemented these new buttons, and disabled the automatic wrap-around for the prev/next buttons in block-nav mode.
2025-02-24 09:32:19 +08:00
leo
2b4fc64c73
fix: resolve conflict with deleted files does not work (#1009)
Signed-off-by: leo <longshuang@msn.cn>
2025-02-21 10:26:14 +08:00
leo
10fba08e43
code_review: PR #949
Signed-off-by: leo <longshuang@msn.cn>
2025-02-11 11:07:33 +08:00
Doodeletion
821063e3ec
Swap selection start and end index if selection is created from bottom to top (#967) 2025-02-11 10:57:20 +08:00
leo
12597fd3e3
code_style: run dotnet format
Signed-off-by: leo <longshuang@msn.cn>
2025-02-07 12:06:29 +08:00
leo
ab080b53b1
enhance: exclude indicators or empty blocks in diff text view while copying text (#924) 2025-01-24 11:41:11 +08:00
leo
e17b53da42
enhance: block-navigation in text diff view
* It is not necessary to re-calculate all the contents when `UseBlockNavigation` changed
* Redraw the text view after `block-navigation` has turned off
2024-12-12 09:44:55 +08:00
leo
962055dd2a
code_style: run dotnet format
Signed-off-by: leo <longshuang@msn.cn>
2024-12-08 21:51:33 +08:00
leo
15d3ad355d
code_review: PR #703
* change the name of this feature to `Enable Block-Navigation`
* change the icon of the toggle button used to enable this feature
* use a new class `BlockNavigation` to hold all the data about this feature
* create `BlockNavigation` data only when it is enabled

Signed-off-by: leo <longshuang@msn.cn>
2024-12-08 21:02:30 +08:00
Göran W
655d71b0bc
Add navigation and highlighting of change-blocks in Text Diff (#616, #717) (#703)
* Corrected misspelled local variable nextHigh(t)light

* Implemented change-block navigation

* Modified behavior of the Prev/Next Change buttons in DiffView toolbar.
* Well-defined change-blocks are pre-calculated and can be navigated between.
* Current change-block is highlighted in the Diff panel(s).
* Prev/next at start/end of range (re-)scrolls to first/last change-block
(I.e when unset, or already at first/last change-block, or at the only one.)
* Current change-block is unset in RefreshContent().

* Added safeguards for edge cases

* Added indicator of current/total change-blocks in DiffView toolbar

* Added new Icon and String (en-US) for Highlighted Diff Navigation

* Added Preference and ToggleButton for diff navigation style
2024-12-08 17:50:33 +08:00
leo
bb41fcea3e
fix: DisplayRange is not updated when text diff view is opened for the first time 2024-11-26 19:52:13 +08:00
leo
b2e01f0d3e
feature: add tooltip for SHA in commit message presenter (#734)
Signed-off-by: leo <longshuang@msn.cn>
2024-11-24 21:22:04 +08:00
leo
73687689ce
ux: min height of change block in minimap
Signed-off-by: leo <longshuang@msn.cn>
2024-11-19 16:45:07 +08:00
leo
f45bed6f92
fix: avoid NRE
Signed-off-by: leo <longshuang@msn.cn>
2024-11-19 10:31:17 +08:00
leo
3b09ea45f5
feature: add change minimap for text diff view
Signed-off-by: leo <longshuang@msn.cn>
2024-11-17 21:49:33 +08:00
leo
882878dbe5
refactor: text diff view go to next/prev change
Signed-off-by: leo <longshuang@msn.cn>
2024-11-16 18:24:37 +08:00
leo
134c71064e
feature: add buttons to go to prev/next change in text diff view (#616)
Signed-off-by: leo <longshuang@msn.cn>
2024-11-16 15:17:29 +08:00
leo
6209326fe0
code_review: PR #652
* update localization for zh_CN and zh_TW
* change the icon for `Icons.Lines.All`
* reorder diff view toolbar buttons
* move private methods after protected

Signed-off-by: leo <longshuang@msn.cn>
2024-11-04 16:49:15 +08:00
Göran W
1a8acbf934
feature: diff - toggle show all lines (#615) (#652)
* Renamed 1 of 2 SyncScrollOffset props, for clarity

The property "SyncScrollOffset" in TextDiff is distinct from the one with the same name in TwoSideTextDiff. These two properties are used in separate (though slightly related) ways and are not really connected.

The one in TwoSideTextDiff is mainly used to keep the scroll-pos of the two SingleSideTextDiffPresenter views in sync (aligned), while the one in TextDiff is used only to preserve/reset the scroll-pos in the single CombinedTextDiffPresenter view when (re)loading Diff Content (so not really syncing anything).

To clarify this and to make the two properties more distinguishable, I renamed the one in TextDiff to simply "ScrollOffset".

* Added icon and string for "Show All Lines"

New StreamGeometry "Icons.Lines.All" using SVG path from "text_line_spacing_regular" at https://avaloniaui.github.io/icons.html.
New String "Text.Diff.VisualLines.All" for en_US locale (no translations yet).

* Implemented new TextDiff feature "Show All Lines" (toggle)

* Added new ToggleButton in DiffView toolbar, visible when IsTextDiff, disabling the buttons "Increase/Decrease Number of Visible Lines" when on.

* Added new Preference property "UseFullTextDiff".

* Added StyledProperty "UseFullTextDiffProperty" in TextDiffView, with a DataTemplate binding to the corresponding preference property.

* When changed, UseFullTextDiffProperty is handled identically as UseSideBySideDiffProperty (via new helper method RefreshContent(), for unification with OnDataContextChanged()).

* Added new method DiffContext.ToggleFullTextDiff() for changing the preference property and reloading the diff content.

* Implemented the new feature by overriding the "unified" (number of context lines) for Commands.Diff() with a very high number.

NOTE: The number used (~1 billion) is supposed to be the highest one working on Mac, according to this forum comment: https://stackoverflow.com/questions/28727424/for-git-diff-is-there-a-uinfinity-option-to-show-the-whole-file#comment135202820_28846576
2024-11-04 16:32:51 +08:00
leo
163e8cc0a4
feature: add context menu for issue link in commit details panel (#651)
Signed-off-by: leo <longshuang@msn.cn>
2024-11-04 15:31:55 +08:00
leo
a5594130ed
code_style: run dotnet format
Signed-off-by: leo <longshuang@msn.cn>
2024-10-23 15:28:09 +08:00
leo
d4302b4faa
refactor: render +/- marks after line number
Signed-off-by: leo <longshuang@msn.cn>
2024-10-23 15:19:59 +08:00
leo
f6e1e65a53
feature: add +/- in line number to indicate type of change (#593) 2024-10-23 12:03:22 +08:00
leo
3af30f54b6
enhance: avoid flicker at the first time clicking on text diff view 2024-09-29 14:16:42 +08:00
leo
d5671ea8df
enhance: only re-calculate highlight chunk when it is needed 2024-09-29 13:48:48 +08:00
leo
e945367b28
enhance: avoid re-calcuting highlight chunk when move mouse from stage/unstage buttons to text area 2024-09-29 12:11:09 +08:00
leo
934d784d40
fix: unable to access the Stage/Unstage buttons in diff viewer when line wrap is enabled (#481)
* disable line wrap in side-by-side diff mode
2024-09-17 22:26:35 +08:00
leo
55d2657799
ux: better line number layout 2024-08-19 19:54:46 +08:00
leo
84b8735d6c
code_style: run dotnet format 2024-08-18 23:14:44 +08:00
leo
39fba17648
enhance: text editor (#365)
* support extra grammars.
* avoid crashing on text editor detached from visual tree
2024-08-18 00:18:18 +08:00
leo
a3496a9d2f
fix: virtual space not include (#364) 2024-08-16 19:21:48 +08:00
leo
ed7465def5
enhance: render highlight background manually instead of using TextRunProperties.SetBackgroundBrush(IBrush) (#364) 2024-08-16 18:59:48 +08:00
leo
9f39a9b295
fix: background not fill entire text line (#364) 2024-08-16 17:28:00 +08:00
leo
6d11296eae
enhance: update selected chunk after stage/discard/unstage previous chunk (#361) 2024-08-16 15:11:35 +08:00
leo
f8bc48c49c
enhance: exec git command directly instead of call methods from WorkingCopy (#330) 2024-08-08 09:33:46 +08:00