-
-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CodeEditor related changes and ko language added #215
Conversation
…ew is null. 2. Add IPropertyGrid to Demo.Modules.Startup.Module. and refresh it when ActiveDocument is changed. 3. Update StatusBar items(Line Number and Column) when the caret in a code editor is
Update from original (2016-07-14)
This looks great 👍 It will knock off 2 of the items on my ToDo list, MRU and Korean translation. Thanks! |
Also 👍 for the German and Chinese translation of the new strings. |
_shell = shell; | ||
} | ||
|
||
public override async Task Run(Command command) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nitpick, remove the async and return TaskUtility.Completed here, otherwise the compiler will give warnings.
EchterAgo, many thanks for warm replies. This was my first activity in the GitHub. After initial pull requesting, I modified 3 more little things: |
Nice, thank you :) |
"ko-KR" should be used? "ko" is working fine in Gemini solution, but my other project, referencing Gemini.dll, shows a running error: Can only set culture to an existing culture. It may be from Gu.Localization.Translator.set_CurrentCulture(CultureInfo value) |
I am not sure, I would check, but I somehow can't get the demo to run with your changes. I get a 'System.ComponentModel.Composition.CompositionException' indicating that there is a dependency loop:
|
I was able to get the demo to run with your changes by changing the demo startup module to use IoC.Get to get the propertygrid like this: private void RefreshPropertyGrid()
{
var propertyGrid = IoC.Get<IPropertyGrid>();
if (Shell.ActiveItem != null)
propertyGrid.SelectedObject = Shell.ActiveItem;
else
propertyGrid.SelectedObject = null;
} In my application Korean seems to be working fine with just "ko", no "ko-KR" needed |
Got an exception when testing the MRU files. Opened two files, they appeared in the MRU list. Restarted application, used first MRU entry, got this exception:
|
Ok, it seems like the code does not handle having an unsaved document open correctly. When you check if the document is open already, you need to check if the document actually has a filename. I would suggest checking for !IsNew like this: public async Task Run(Command command)
{
var newPath = (string)command.Tag;
// Check if the document is already open
foreach (var document in _shell.Documents.OfType<PersistedDocument>().Where(d => !d.IsNew))
{
if (string.IsNullOrEmpty(document.FilePath))
continue;
var docPath = Path.GetFullPath(document.FilePath);
if (string.Equals(newPath, docPath, System.StringComparison.OrdinalIgnoreCase))
{
_shell.OpenDocument(document);
return;
}
}
_shell.OpenDocument(await GetEditor(newPath));
// Add the file to the recent documents list
_shell.RecentFiles.Update(newPath);
} |
Same for OpenFileCommandHandler. Also, I would suggest not duplicating the GetEditor function, maybe put it somewhere into the Framework. |
@diluculo, these changes look great, thank you. I'm just about to get on a plane, so I can't review this properly now, but my initial feedback is that I'd like to see this split up into separate pull requests. (It's hard to review the differences when they're all in one big PR.) I hope that won't create too much work for you - where the commits don't depend on each other, you should be able to get them on their own branch without needing to redo or rebase the commits. |
I already made a cleanup of the pull request here: https://github.com/EchterAgo/gemini/tree/ko_kr_cleanup Just needs to be pulled apart and made into separate branches. |
Thanks for comments and changes. I will try to separate chunks into small branches and keep my master branch clean. By the way, wrt CodeEditor, I couldn't find a way to activate Undo/Redo menus in the menu bar and the toolbar. I think simple solution may be linking them to AvalonEdit's UndoStack. Please give me a hint where I have to start. |
I created a ticket for the UndoRedo stack integration here #216 |
@diluculo are you using the cleaned up version I made? Because if not, I have some change suggestions |
In the meantime, I reset my master to match the remote original, and I am trying to fork your cleaned up version, as a new starting point... |
BTW, there is one change I forgot, I moved the duplicate document check On Jul 19, 2016 16:54, "diluculo" [email protected] wrote:
|
@EchterAgo , Please let me know how to fork your cleanup branch and clone it to my local PC. Today, I searched and tried, but failed. Is there any good reference? |
If you use the Git command line, you can use the following on your local PC:
This will create a local branch with just my changes. If you want, I can also do the work to get this into separate branches, although there will be some dependencies, but if you want to learn how to use git for this, I will be happy to help you learn. |
Basically to send clean patches to an open source project, you need to do a lot of rebasing and commit squashing. You should generally try to keep one change unit in one commit without intermediate commits, which is achieved by rebasing and squashing. To rebase you would use something like:
This assumes that you have a remote called Just tell me if you need help. You can email me at [email protected] if you need help with this, just to keep that discussion out of the pull request. |
@EchterAgo Really many thanks for your kind help. Now, I can start to code again based on your branch. |
When a CodeEditor document is new, but dirty, To fix it, I modified
I think |
In the CodeEditor module, I changed something not-yet-implemented :
Changes in Shell - Menu
Changes in Modules.CodeEditor
Changes in Demo.Modules.Startup.Module
Changes in language resouces