Sublime Forum

Build 3193

#1

Thanks for the new build, the inline diffs looks so great !

I really like how the diff display as regular code and can be selected / copied with regular keybindings.
And “select_all” restricts itself to the inline diff. Is this because the diff is treated as a separate view ?

Can we have commands for:

  • moving your cursor to the closest inline diff (I’d rather not use the mouse for that.)
  • reverting the diff

Lastly, will there be a new plugin API to be able to create similar readonly regions ? or are they just very well integrated phantoms ?

1 Like

#2

We have modification-level navigation and revert (as oppossed to hunk level) - see the Goto / Next Modification and Edit / Text / Revert Modification menu items

1 Like

#3

The deleted text is shown via a text phantom, which are similar-but-different to the html phantoms available via the API

0 Likes

#4

Could we have a command for reverting hunk (like GitGutter) or a command that selects the whole hunk (then I could revert it with the current revert_modification)? :slight_smile:

The new toggle_inline_diff command is awesome, btw.

2 Likes

#5

Full ack! Great work @jps and the team! Thank you very much :slight_smile:

0 Likes

#6

I find a bug in this new version.
So basically if a have the diff “open” and open the Command Palette, and scroll its work fine.

But if open the Command Palette when the initial code is deleted, the Command Palette appear bellow to the diff_deleted.

0 Likes

#7

Thanks, found them!

Here are the relevant commands:

	{ "keys": ["ctrl+."], "command": "next_modification" },
	{ "keys": ["ctrl+,"], "command": "prev_modification" },
	{ "keys": ["super+k", "super+z"], "command": "revert_modification" },
	{ "keys": ["super+k", "super+forward_slash"], "command": "toggle_inline_diff" },
	{ "keys": ["super+k", "super+;"], "command": "toggle_inline_diff", "args": { "prefer_hide": true } },
1 Like

#8

Hi @gwenzek.

What does the prefer_hide do? How do you find that arg?

{ "keys": ["super+k", "super+;"], "command": "toggle_inline_diff", "args": { "prefer_hide": true } },
0 Likes

#9

I am struggling to understand how inline diffs work - When I right click a new line in an existing file (which is tracked by GIT) , I see a new option - “Line History” . On clicking on it - it opens Sublime Merge with the changes. Is this how is it supposed to work ? Please confirm .

Thanks and Regards
Gagan

0 Likes

#10

It’s Show Diff Hunk in the menu.

0 Likes

#11

I can confirm. On initial render the Command Pallet renders underneath the phantom with deleted code. I have to scroll a little bit to bring the pallet to the foreground

0 Likes

#12

@jfcherng , It seems that option is not present for me.I am on the latest build

0 Likes

#13

You have to right-click on a line that has been modified. Additionally, mini_diff must be enabled (the default).

0 Likes

#14

@wbond On a modified line, I right click and choose “Line History” , it opens in Sublime Merge , is that correct ?

0 Likes

#16

No. Choose Show Diff Hunk.

0 Likes

#17

This is what I see

I have mini_diff turned to true

0 Likes

#18

Maybe Mac has a different context menu from Windows’. :sweat_smile:
It’s located above Cut on Windows…

Maybe you can try its keybinding (cmd+k, cmd+/ on macOS)

0 Likes

#19

Tried doing that as well - it comments out the line for me.

0 Likes

#20

The feature Line History is supposed to open Sublime Merge, yes.

0 Likes

#21

Sorry for the spam and the misunderstanding on my part. The changelog says "Inline Diffs … " . Am I on the right track ?

0 Likes