From: Jean-Philippe Bruyère Date: Sat, 13 Feb 2021 10:35:03 +0000 (+0100) Subject: save commit X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=77beac56662bcc99dd9ba66ec8efd20e7618a370;p=jp%2Fcrowedit.git save commit --- diff --git a/Crow.Coding/Crow.Coding.csproj b/Crow.Coding/Crow.Coding.csproj index 48dc4ec..5057a88 100644 --- a/Crow.Coding/Crow.Coding.csproj +++ b/Crow.Coding/Crow.Coding.csproj @@ -1,7 +1,7 @@ - netstandard2.0 + netstandard2.1 false diff --git a/Crow.Coding/src/CodeBuffer/TextEditor.cs b/Crow.Coding/src/CodeBuffer/TextEditor.cs index 7006798..84fc801 100644 --- a/Crow.Coding/src/CodeBuffer/TextEditor.cs +++ b/Crow.Coding/src/CodeBuffer/TextEditor.cs @@ -382,7 +382,7 @@ namespace Crow.Text Rectangle cb = ClientRectangle; - Foreground.SetAsSource (gr); + Foreground.SetAsSource (IFace, gr); buffer.editMutex.EnterReadLock (); //editorMutex.EnterReadLock (); diff --git a/Crow.Coding/src/Parsers/CSharpParser.cs b/Crow.Coding/src/Parsers/CSharpParser.cs index 23655aa..6e8d951 100644 --- a/Crow.Coding/src/Parsers/CSharpParser.cs +++ b/Crow.Coding/src/Parsers/CSharpParser.cs @@ -320,7 +320,6 @@ namespace Crow.Coding continue; } cl.SyntacticNode = null; - int tokPtr = 0; bool onlyWhiteSpace = true; while (tokPtr < cl.Tokens.Count) { diff --git a/Crow.Coding/src/SourceEditor.cs b/Crow.Coding/src/SourceEditor.cs index 4913dda..4b7ac72 100644 --- a/Crow.Coding/src/SourceEditor.cs +++ b/Crow.Coding/src/SourceEditor.cs @@ -582,11 +582,11 @@ namespace Crow.Coding level = currentNode.Level - 1; } - /*for (int l = 0; l < level; l++) { - gr.MoveTo (rFld.Center.X + 0.5, y); - gr.LineTo (rFld.Center.X + 0.5, y + fe.Ascent + fe.Descent); - rFld.Left += foldHSpace; - }*/ + //for (int l = 0; l < level; l++) { + // gr.MoveTo (rFld.Center.X + 0.5, y); + // gr.LineTo (rFld.Center.X + 0.5, y + fe.Ascent + fe.Descent); + // rFld.Left += foldHSpace; + //} if (level > 0) { gr.MoveTo (rFld.Center.X + 0.5, y); gr.LineTo (rFld.Center.X + 0.5, y + fe.Ascent + fe.Descent); @@ -786,6 +786,8 @@ namespace Crow.Coding gr.SetFontSize (Font.Size); fe = gr.FontExtents; + //trick to solve win32 maxXAdvance inconsistance + fe.MaxXAdvance = gr.TextExtents ("A").XAdvance; } MaxScrollY = 0; RegisterForGraphicUpdate (); @@ -819,12 +821,10 @@ namespace Crow.Coding Rectangle cb = ClientRectangle; - - Foreground.SetAsSource (gr); + Foreground.SetAsSource (IFace, gr); buffer.editMutex.EnterReadLock (); - editorMutex.EnterReadLock (); - + editorMutex.EnterReadLock (); #region draw text cursor if (buffer.SelectionInProgress){ selStartCol = getTabulatedColumn (buffer.SelectionStart); @@ -859,14 +859,14 @@ namespace Crow.Coding break; drawLine (gr, cb, i); } - double y = cb.Y + (fe.Ascent + fe.Descent) * i, x = cb.X; + /*double y = cb.Y + (fe.Ascent + fe.Descent) * i, x = cb.X; if (y < cb.Bottom) { //draw end of margin Rectangle mgR = new Rectangle ((int)x, (int)y, leftMargin - leftMarginGap, (int)(cb.Bottom - y)); gr.SetSource (Colors.Grey); gr.Rectangle (mgR); gr.Fill (); - } + }*/ } editorMutex.ExitReadLock (); diff --git a/CrowEdit.csproj b/CrowEdit.csproj index 065e4ff..5f3d623 100644 --- a/CrowEdit.csproj +++ b/CrowEdit.csproj @@ -1,7 +1,7 @@ - + - net472 - Exe + netcoreapp3.1 + WinExe false diff --git a/Images/crow.png b/Images/crow.png new file mode 100644 index 0000000..7b737d0 Binary files /dev/null and b/Images/crow.png differ diff --git a/Images/crow0.svg b/Images/crow0.svg new file mode 100644 index 0000000..c621130 --- /dev/null +++ b/Images/crow0.svg @@ -0,0 +1,30 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/Images/screenshot.png b/Images/screenshot.png new file mode 100644 index 0000000..3540d6b Binary files /dev/null and b/Images/screenshot.png differ diff --git a/Images/screenshot2.png b/Images/screenshot2.png new file mode 100644 index 0000000..46a7bec Binary files /dev/null and b/Images/screenshot2.png differ diff --git a/Images/screenshot3.png b/Images/screenshot3.png new file mode 100644 index 0000000..044d991 Binary files /dev/null and b/Images/screenshot3.png differ diff --git a/Images/screenshot4.png b/Images/screenshot4.png new file mode 100644 index 0000000..8605e77 Binary files /dev/null and b/Images/screenshot4.png differ diff --git a/src/CrowEdit.cs b/src/CrowEdit.cs index cfe2b1f..970aa4b 100644 --- a/src/CrowEdit.cs +++ b/src/CrowEdit.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2013-2020 Jean-Philippe Bruyère +//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.// Copyright (c) 2013-2020 Jean-Philippe Bruyère // // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) @@ -195,12 +195,33 @@ namespace CrowEdit } void openFile (string filePath, string directory) { CurrentFilePath = Path.Combine(directory, filePath); + //reloadFromFile (); + redoStack.Clear (); undoStack.Clear (); CMDRedo.CanExecute = false; CMDUndo.CanExecute = false; } - + /***temp***/ + string source; + public string Source { + get => source; + set { + if (source == value) + return; + source = value; + NotifyValueChanged (source); + } + } + void reloadFromFile () { + if (File.Exists (CurrentFilePath)) { + using (Stream s = new FileStream (CurrentFilePath, FileMode.Open)) { + using (StreamReader sr = new StreamReader (s)) + Source = sr.ReadToEnd (); + } + } + } + /********************************/ [STAThread] static void Main () { diff --git a/ui/main.crow b/ui/main.crow index 4500e70..1695b3f 100755 --- a/ui/main.crow +++ b/ui/main.crow @@ -34,7 +34,10 @@ - --> +