mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-14 14:24:10 +02:00
Added Sync with Workspace Panel option
This commit is contained in:
parent
c3238272d0
commit
3f68473fe1
6 changed files with 54 additions and 0 deletions
|
@ -117,6 +117,10 @@ namespace Beefy.widgets
|
||||||
return (KeyCode)c;
|
return (KeyCode)c;
|
||||||
if ((c >= 'a') && (c <= 'a'))
|
if ((c >= 'a') && (c <= 'a'))
|
||||||
return (KeyCode)(c.ToUpper);
|
return (KeyCode)(c.ToUpper);
|
||||||
|
if (c == '[')
|
||||||
|
return (KeyCode)LBracket;
|
||||||
|
if (c == ']')
|
||||||
|
return (KeyCode)RBracket;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (str.StartsWith("0x"))
|
if (str.StartsWith("0x"))
|
||||||
|
@ -137,6 +141,21 @@ namespace Beefy.widgets
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char8 c = 0;
|
||||||
|
switch (this)
|
||||||
|
{
|
||||||
|
case LBracket:
|
||||||
|
c = '[';
|
||||||
|
case RBracket:
|
||||||
|
c = ']';
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
if (c != 0)
|
||||||
|
{
|
||||||
|
strBuffer.Append(c);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int buffStart = strBuffer.Length;
|
int buffStart = strBuffer.Length;
|
||||||
base.ToString(strBuffer);
|
base.ToString(strBuffer);
|
||||||
if ((strBuffer.Length > buffStart) && (strBuffer[buffStart].IsDigit))
|
if ((strBuffer.Length > buffStart) && (strBuffer[buffStart].IsDigit))
|
||||||
|
|
|
@ -288,6 +288,7 @@ namespace IDE
|
||||||
Add("Step Out", new => gApp.[Friend]StepOut);
|
Add("Step Out", new => gApp.[Friend]StepOut);
|
||||||
Add("Step Over", new => gApp.[Friend]StepOver);
|
Add("Step Over", new => gApp.[Friend]StepOver);
|
||||||
Add("Stop Debugging", new => gApp.[Friend]StopRunning);
|
Add("Stop Debugging", new => gApp.[Friend]StopRunning);
|
||||||
|
Add("Sync With Workspace Panel", new => gApp.[Friend]SyncWithWorkspacePanel);
|
||||||
Add("Tab First", new => gApp.[Friend]TabFirst);
|
Add("Tab First", new => gApp.[Friend]TabFirst);
|
||||||
Add("Tab Last", new => gApp.[Friend]TabLast);
|
Add("Tab Last", new => gApp.[Friend]TabLast);
|
||||||
Add("Tab Next", new => gApp.[Friend]TabNext);
|
Add("Tab Next", new => gApp.[Friend]TabNext);
|
||||||
|
|
|
@ -4900,6 +4900,13 @@ namespace IDE
|
||||||
return activePanel.mParent as DarkTabbedView;
|
return activePanel.mParent as DarkTabbedView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SyncWithWorkspacePanel()
|
||||||
|
{
|
||||||
|
var activeSourceViewPanel = GetActiveSourceViewPanel();
|
||||||
|
if (activeSourceViewPanel != null)
|
||||||
|
activeSourceViewPanel.SyncWithWorkspacePanel();
|
||||||
|
}
|
||||||
|
|
||||||
[IDECommand]
|
[IDECommand]
|
||||||
void TabFirst()
|
void TabFirst()
|
||||||
{
|
{
|
||||||
|
@ -13537,6 +13544,7 @@ namespace IDE
|
||||||
[Import("user32.lib"), CLink, CallingConvention(.Stdcall)]
|
[Import("user32.lib"), CLink, CallingConvention(.Stdcall)]
|
||||||
public static extern bool MessageBeep(MessageBeepType type);
|
public static extern bool MessageBeep(MessageBeepType type);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
|
|
|
@ -599,6 +599,7 @@ namespace IDE
|
||||||
public bool mFreeCursorMovement;
|
public bool mFreeCursorMovement;
|
||||||
public FileRecoveryKind mEnableFileRecovery = .Yes;
|
public FileRecoveryKind mEnableFileRecovery = .Yes;
|
||||||
public bool mFormatOnSave = false;
|
public bool mFormatOnSave = false;
|
||||||
|
public bool mSyncWithWorkspacePanel = false;
|
||||||
|
|
||||||
public void Serialize(StructuredData sd)
|
public void Serialize(StructuredData sd)
|
||||||
{
|
{
|
||||||
|
@ -623,6 +624,7 @@ namespace IDE
|
||||||
sd.Add("FreeCursorMovement", mFreeCursorMovement);
|
sd.Add("FreeCursorMovement", mFreeCursorMovement);
|
||||||
sd.Add("EnableFileRecovery", mEnableFileRecovery);
|
sd.Add("EnableFileRecovery", mEnableFileRecovery);
|
||||||
sd.Add("FormatOnSave", mFormatOnSave);
|
sd.Add("FormatOnSave", mFormatOnSave);
|
||||||
|
sd.Add("SyncWithWorkspacePanel", mSyncWithWorkspacePanel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Deserialize(StructuredData sd)
|
public void Deserialize(StructuredData sd)
|
||||||
|
@ -651,6 +653,7 @@ namespace IDE
|
||||||
sd.Get("FreeCursorMovement", ref mFreeCursorMovement);
|
sd.Get("FreeCursorMovement", ref mFreeCursorMovement);
|
||||||
sd.GetEnum<FileRecoveryKind>("EnableFileRecovery", ref mEnableFileRecovery);
|
sd.GetEnum<FileRecoveryKind>("EnableFileRecovery", ref mEnableFileRecovery);
|
||||||
sd.Get("FormatOnSave", ref mFormatOnSave);
|
sd.Get("FormatOnSave", ref mFormatOnSave);
|
||||||
|
sd.Get("SyncWithWorkspacePanel", ref mSyncWithWorkspacePanel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetDefaults()
|
public void SetDefaults()
|
||||||
|
@ -796,6 +799,7 @@ namespace IDE
|
||||||
Add("Step Out", "Shift+F11");
|
Add("Step Out", "Shift+F11");
|
||||||
Add("Step Over", "F10");
|
Add("Step Over", "F10");
|
||||||
Add("Stop Debugging", "Shift+F5");
|
Add("Stop Debugging", "Shift+F5");
|
||||||
|
Add("Sync With Workspace Panel", "Ctrl+[, S");
|
||||||
Add("Tab First", "Ctrl+Alt+Home");
|
Add("Tab First", "Ctrl+Alt+Home");
|
||||||
Add("Tab Last", "Ctrl+Alt+End");
|
Add("Tab Last", "Ctrl+Alt+End");
|
||||||
Add("Tab Next", "Ctrl+Alt+PageDown");
|
Add("Tab Next", "Ctrl+Alt+PageDown");
|
||||||
|
|
|
@ -124,6 +124,7 @@ namespace IDE.ui
|
||||||
AddPropertiesItem(category, "Free Cursor Movement", "mFreeCursorMovement");
|
AddPropertiesItem(category, "Free Cursor Movement", "mFreeCursorMovement");
|
||||||
AddPropertiesItem(category, "Enable File Recovery", "mEnableFileRecovery");
|
AddPropertiesItem(category, "Enable File Recovery", "mEnableFileRecovery");
|
||||||
AddPropertiesItem(category, "Format on Save", "mFormatOnSave");
|
AddPropertiesItem(category, "Format on Save", "mFormatOnSave");
|
||||||
|
AddPropertiesItem(category, "Sync with Workspace Panel", "mSyncWithWorkspacePanel");
|
||||||
|
|
||||||
category.Open(true, true);
|
category.Open(true, true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2445,6 +2445,22 @@ namespace IDE.ui
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SyncWithWorkspacePanel()
|
||||||
|
{
|
||||||
|
if (gApp.mProjectPanel.[Friend]mProjectToListViewMap.TryGet(mProjectSource, var matchKey, var projectListViewItem))
|
||||||
|
{
|
||||||
|
var checkLVItem = projectListViewItem.mParentItem;
|
||||||
|
while (checkLVItem != null)
|
||||||
|
{
|
||||||
|
checkLVItem.Open(true);
|
||||||
|
checkLVItem = (ProjectListViewItem)checkLVItem.mParentItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
projectListViewItem.mListView.GetRoot().SelectItemExclusively(projectListViewItem);
|
||||||
|
projectListViewItem.mListView.EnsureItemVisible(projectListViewItem, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override void EditGotFocus()
|
public override void EditGotFocus()
|
||||||
{
|
{
|
||||||
if (mFilePath != null)
|
if (mFilePath != null)
|
||||||
|
@ -2488,6 +2504,11 @@ namespace IDE.ui
|
||||||
|
|
||||||
gApp.mLastActiveSourceViewPanel = this;
|
gApp.mLastActiveSourceViewPanel = this;
|
||||||
gApp.mLastActivePanel = this;
|
gApp.mLastActivePanel = this;
|
||||||
|
|
||||||
|
if ((gApp.mSettings.mEditorSettings.mSyncWithWorkspacePanel) && (mProjectSource != null))
|
||||||
|
{
|
||||||
|
SyncWithWorkspacePanel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void EditLostFocus()
|
public override void EditLostFocus()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue