About Monkey 2 › Forums › Monkey 2 Development › [Ted] Added feature to re open files.
This topic contains 1 reply, has 1 voice, and was last updated by 
 cocon 2 years, 9 months ago.
- 
		AuthorPosts
 - 
		
			
				
July 19, 2016 at 2:18 am #2269
I really like using Sublime for complex editing, but also I prefer compiling with IDEs, in this case Ted. It’s a matter of getting more informative reporting and debugging features when correcting the code.
While saving a file with Ted, Sublime can auto-load the newer version, how ever Ted does not allow that (yet). This was a common problem with Monkey1, Blitzmax, etc, and I decided to something about it.
In this case you get the ability to reopen the file immediately “no-questions-asked” in order to get that feeling of semi automatic reloading. As an added convenience, you can use the Ctrl-R shortcut.

P.S. Perhaps later I might try to replace that with an auto-load feature as well, that will require an event timer run constantly on the background and check the timestamp difference once per second.
How to apply the patch:
- Have git in your PC (I use github desktop client because it’s very minimal).
 - Initialize git for the ted project (drag and drop the folder to github client).
…\monkey2\src\ted2 - Do the first commit for backup purposes.
 - Check info about how to apply the patch:
https://git-scm.com/docs/git-apply
https://ariejan.net/2009/10/26/how-to-create-and-apply-a-patch-with-git/ - Now open …\monkey2\src\ted2\ted2.monkey2 and build a release version.
 - The project is compiled here (the operating system naming varies):
…\monkey2\src\ted2\ted2.buildv1.0.0\desktop_release_windows - Copy only the ted2.exe to this location …\monkey2\bin\ted2_windows. Perhaps you might want to backup the original ted2 exe just to keep you head clear (give it a name like ted2backup, so you won’t replace anything).
 - Now you can start Monkey as you normally would
…\monkey2\Monkey2 (Windows).exe 
diff1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071From d637229bc9dece1354dd64aaf19ae7a586de44f6 Mon Sep 17 00:00:00 2001From: concon <zzz@zzz.com>Date: Tue, 19 Jul 2016 04:39:05 +0300Subject: [PATCH] Added feature to reopen the document.---.gitignore | 3 +++mainwindow.monkey2 | 13 +++++++++++++2 files changed, 16 insertions(+)diff --git a/.gitignore b/.gitignoreindex 49f18f2..96dbc2a 100644--- a/.gitignore+++ b/.gitignore@@ -301,3 +301,6 @@ $RECYCLE.BIN/# Windows shortcuts*.lnk+++/*buildv*/\ No newline at end of filediff --git a/mainwindow.monkey2 b/mainwindow.monkey2index 7003710..f0e0a3c 100644--- a/mainwindow.monkey2+++ b/mainwindow.monkey2@@ -21,6 +21,7 @@ Class MainWindowInstance Extends Window'actionsField _fileNew:ActionField _fileOpen:Action+ Field _fileReOpen:ActionField _fileClose:ActionField _fileCloseAll:ActionField _fileSave:Action@@ -110,6 +111,12 @@ Class MainWindowInstance Extends WindowSaveState()End+ Method OnFileReOpen()+ Local path:=_currentDoc.Path+ CloseDocument( _currentDoc )+ OpenDocument( path )+ End+Method OnFileClose()If Not _currentDoc Return@@ -525,6 +532,11 @@ Class MainWindowInstance Extends Window_fileOpen.HotKeyModifiers=Modifier.Control_fileOpen.Triggered=OnFileOpen+ _fileReOpen=New Action( "ReOpen" )+ _fileReOpen.HotKey=Key.R+ _fileReOpen.HotKeyModifiers=Modifier.Control+ _fileReOpen.Triggered=OnFileReOpen+_fileClose=New Action( "Close" )_fileClose.HotKey=Key.F4_fileClose.HotKeyModifiers=Modifier.Control@@ -682,6 +694,7 @@ Class MainWindowInstance Extends Window_fileMenu.AddAction( _fileNew )_fileMenu.AddSubMenu( _newFiles )_fileMenu.AddAction( _fileOpen )+ _fileMenu.AddAction( _fileReOpen )_fileMenu.AddSubMenu( _recentFiles )_fileMenu.AddSeparator()_fileMenu.AddAction( _fileClose )--2.8.1.windows.1July 19, 2016 at 2:28 am #2270If you are in a hurry get this file:
https://1drv.ms/u/s!AquVr9J7xRcsgWnlSlXH8i6-b_lV - 
		AuthorPosts
 
You must be logged in to reply to this topic.