Eclipse - Showing changes before saving - eclipse

I run into this problem a lot. Sometimes I would edit and forget about it in Eclipse or maybe keyboard moved randomly and input random characters. How do I view current changes compared to the last save easily in Eclipse? That way, I would know what changes took effect before I save.

If you just want to see what lines have changed, then you can follow the instructions in this answer in order to show a highlight of the changed lines on the left-hand side of your editor.
Aside from that I don't think it's easy to tell what's recently been changed without saving. If you do save then you have the option of comparing with the previous version: right-click on the file in the tree and choose "Compare With -> Local History" and then choose a version you saved earlier.
If you save it you can also compare against what's in source control, of course. You are using some sort of source control?

You can use either
compare editor-show changes between 2 or 3 files by showing each file side-by-side
First select the files on the Project Explorer with control-click.
Now right-click -> Select Compare With / Each Other.
or
Quick Diff - General > Editors > Text Editors > Quick Diff

Related

show code modification overview in ecplise IDE

i am using an eclipse based IDE and have a library with some files that i need to make additions/changes to. what is the best way to quickly see the all the modifications of all files in a list/tab in eclipse IDE?
i know there is the useful "#TODO" tag that shows all tasks in a nice view/tab. as im using this quite heavily, i would like to have a special view/tab that just shows the modifications and separates them from the todos.
EDIT:
thx for the suggestions and the local history tipp.
sorry for not making myself clearer. ive added a screenshot.
when i add "TODO" the tasks show up in the tab marked in red - i dont mind setting manually something (like a bookmark) as im not going to make a lot of changes, but ideally they show up like the tasks or another simple overview.
It's could depend of your version control system.
For each, eclipse purpose an associated plugin with a specific view.
Instead that, you could use the History view (Team/ Show local History after a right clic on a file).
Eclipse keeps a history of your changes for a limited number of days (configured in 'Preferences > General > Workspace > Local History'). You can right click on a file and choose 'Compare With > Local History' to see the changes between revisions.
To track all your changes you need to use one of the source control systems (such as SVN, GIT, ...). Eclipse has plugins to support these systems. Once you have installed one of these you can use the 'Team' menu to commit changes and look at the history.
found it!
by clicking "window" - "Show view" - "other" one needs to select the "bookmarks". the bookmarks then show up as a tab next to tasks.
by clicking the right small arrow the bookmark view menu pops up (similiar to the screenshot above with the task menu). the bookmark view can then be configured/filtered by clicking the "Configure contents..." menu link.

Eclipse: Update compare view

Eclipse provides the option to Compare With > Each Other for files.
I'd like to refresh the resulting view for two text files in my target folder successively while developing my application.
F5 does not work.
I have a drop down called JavaScript Source Compare. If I switch between this and Text Compare and back again it does a refresh. This is quicker than closing and reopening. Hope this helps.

Show the name of the containing folder in the Eclipse tab of a file

I have the same set of files in N folders, one of them, say, blank.xhtml. The files contain somewhat similar information and it is becoming overwhelming to figure out which file comes from which folder every time I switch between the tabs. When I open one of them to edit and happen to open a file with the same name from another folder I get confused and more often than not end up editing the wrong file: nullifying my hard work. So I am wondering if there is a way to show the name of a containing folder in the tab like this G-06/blank.xhtml or G-07/blank.xhtml. I will be very very thankful to anybody who has pointers to how I can make this happen.
As an addition to the Maroun's answer there is an alternative solution.
It's not exactly what you want (full name in the tab's title), but may be useful sometimes.
In the "Project Explore" view (the same goes to "Navigator" view) click the "Link with Editor" button. That way, whenever you choose some file opened in the editor, it will be automatically selected/highlighted (see the picture) in the "Project Explorer" view.
Here is the picture:
Maybe this will be useful to you too.
If you hover the mouse over the tab containing the file name then a popup appears showing the full path. Not exactly what you wanted, but it should help. (This with Eclipse Neon.3 Release 4.6.3 on a Mac).
Not quite what you're looking for, but ctrl+shft+e will open the switch editor window that shows all the open editors with their filepaths. I use this shortcut for the same reason. I'll have multiple build.gradle files open from multiple projects and this helps pick the correct one

Eclipse with Subversive - regular svn diff view

Previously I've used command line SVN without any wrappers.
Few days ago I switched to Eclipse with Subversive and have problems with diffs.
Team Sync perspective with Compare view is OK, but it displays whole file, not just changes.
Where I can find something similar to "svn diff" output? I need only changes.
Eclipse Compare views show the entire file which makes sense, as its a GUI. In the Compare view, there are buttons in the top right that enable you to skip from diff to diff (down and up), and the right-hand margin shows locations. So, while its not exactly the same as the command-line, its just as functional. Also, it gives you context for the changes, not just the changed line.
If you need to output a report, that's a little different. You might be able to just click int the top pane, type Ctl-A to select all, Ctl-C to copy, and then paste into a text editor. That might give you just the changes.

Xcode SCM - Need help with checking files back in!

Okay, I have another newbie question. I'm starting to work with a remote code repository, remotehosting.com, and have been given a username, password, and URL. I've been able to successfully associate my project with a remote source code repository, have checked out/pulled down the source files, and have now made a small change to a single file. Here's where my questions start.
1) I can't see anywhere in my GUI where Xcode realizes that I have made a change to a file
2) How do I check my files back in?
I gotta be missing something. The docs I've been reading point to more menu items that I currently see under my SCM menu item. Anybody have any ideas? Thanks in advance for your assistance!!!
File -> Source Control -> Commit, Select the files that you want to commit, add a comment and hit commit button.
This is the flow for xcode 4
In Xcode 3...
The Project window should have a column which displays the SCM status for your files. This can appear both in the "Groups & Files" outline view in the left pane and the file list in the right pane. The icon for the column is a little cylinder shape, a black-and-white version of the yellow cylinder that's shown when you manage repositories. If this column is not displayed, you can right-click on the header of either of those panes to bring up a menu with a list of columns. Select "SCM" from that. The status will display as the same one-letter codes that SVN uses on the command line.
In order to commit files, you can either a) select the particular files, or group you want to commit and use the menu command SCM>Commit Changes..., or b) Select SCM>Commit Entire Project... (which I personally have bound to ⌥-⌘-C in the Xcode key bindings preferences).
Either of these will display a sheet in which you can enter your commit message; the text field in this is very handy in that it accepts the Return key as a newline, rather than passing it to the "Commit" button, but could be confusing the first few times. Press ⌘-Return to activate the button and perform the commit.