[DEVELOPMENT ENVIRONMENT]
* BUG: Comment and uncomment work again in the code editor. git-svn-id: svn://localhost/gambas/trunk@4014 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
5b38c13d65
commit
4d0acf6f72
@ -366,7 +366,7 @@ msgstr ""
|
||||
|
||||
#: CWaitingAnimation.class:56 FColorChooser.form:60 FCommit.form:229
|
||||
#: FConflict.class:191 FConnectionEditor.class:284 FCreateFile.form:436
|
||||
#: FDebugInfo.form:216 FEditor.class:2367 FExportData.class:126
|
||||
#: FDebugInfo.form:216 FEditor.class:2372 FExportData.class:126
|
||||
#: FFieldChooser.form:138 FFontChooser.form:40 FForm.class:2949
|
||||
#: FGotoLine.form:23 FHelpBrowser.form:60 FIconEditor.class:1413
|
||||
#: FList.form:121 FMain.class:200 FMakeInstall.class:327 FMenu.form:374
|
||||
@ -1421,14 +1421,14 @@ msgstr ""
|
||||
msgid "Procedure list"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:2367 FIconEditor.class:2046 FTextEditor.class:495
|
||||
#: FEditor.class:2372 FIconEditor.class:2046 FTextEditor.class:495
|
||||
msgid ""
|
||||
"The file has been modified.\n"
|
||||
"\n"
|
||||
"All your changes will be lost."
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:2795
|
||||
#: FEditor.class:2800
|
||||
msgid "(Declarations)"
|
||||
msgstr ""
|
||||
|
||||
|
@ -61,9 +61,6 @@ Private $bShowPopupHelp As Boolean
|
||||
Private $X As Integer
|
||||
Private $Y As Integer
|
||||
|
||||
Private $iStartLine As Integer
|
||||
Private $iEndLine As Integer
|
||||
|
||||
Private $bDoNotSavePosition As Boolean
|
||||
|
||||
Private Const TYPE_SYMBOL As Integer = 0
|
||||
@ -1347,10 +1344,13 @@ Public Sub mnuComment_Click()
|
||||
If Editor.Selected Then
|
||||
Editor.StoreSelection
|
||||
|
||||
iIndent = GetIndentWidth($iStartLine, $iEndLine)
|
||||
iStartLine = Editor.Selection.StartLine
|
||||
iEndLine = Editor.Selection.EndLine
|
||||
|
||||
iIndent = GetIndentWidth(iStartLine, iEndLine)
|
||||
|
||||
Editor.Begin
|
||||
For iLine = $iStartLine To $iEndLine - 1
|
||||
For iLine = iStartLine To iEndLine - 1
|
||||
Editor.Lines[iLine].Text = Space$(iIndent) & "' " & Mid$(Editor.Lines[iLine].Text, iIndent + 1)
|
||||
Next
|
||||
Editor.End
|
||||
@ -1373,6 +1373,8 @@ Public Sub mnuUncomment_Click()
|
||||
Dim iLine As Integer
|
||||
Dim sLine As String
|
||||
Dim iIndent As Integer
|
||||
Dim iStartLine As Integer
|
||||
Dim iEndLine As Integer
|
||||
|
||||
If Editor.ReadOnly Then Return
|
||||
'IF NOT Editor.Selected THEN RETURN
|
||||
@ -1380,17 +1382,20 @@ Public Sub mnuUncomment_Click()
|
||||
If Editor.Selected Then
|
||||
Editor.StoreSelection
|
||||
|
||||
iIndent = GetIndentWidth($iStartLine, $iEndLine)
|
||||
iStartLine = Editor.Selection.StartLine
|
||||
iEndLine = Editor.Selection.EndLine
|
||||
|
||||
For iLine = $iStartLine To $iEndLine - 1
|
||||
iIndent = GetIndentWidth(iStartLine, iEndLine)
|
||||
|
||||
For iLine = iStartLine To iEndLine - 1
|
||||
sLine = Editor.Lines[iLine].Text
|
||||
If Len(sLine) < (iIndent + 1) Then Break
|
||||
If Left(LTrim(sLine), 1) <> "'" Then Break
|
||||
Next
|
||||
|
||||
If iLine = $iEndLine Then
|
||||
If iLine = iEndLine Then
|
||||
Editor.Begin
|
||||
For iLine = $iStartLine To $iEndLine - 1
|
||||
For iLine = iStartLine To iEndLine - 1
|
||||
If Left(LTrim(Editor.Lines[iLine].Text), 2) = "' " Then
|
||||
Editor.Lines[iLine].Text = Space$(iIndent) & Mid$(LTrim(Editor.Lines[iLine].Text), 3)
|
||||
Else
|
||||
|
@ -5,6 +5,8 @@ Export
|
||||
Private $iStartLine As Integer
|
||||
Private $iEndLine As Integer
|
||||
|
||||
|
||||
|
||||
Public Sub GetPosition() As Integer
|
||||
|
||||
Dim iLine, iColumn, iInd, iPos As Integer
|
||||
@ -134,6 +136,8 @@ Public Sub StoreSelection()
|
||||
$iEndLine = .Selection.EndLine
|
||||
If .Selection.EndColumn > 0 Or Not .Selected Then Inc $iEndLine
|
||||
End With
|
||||
|
||||
RecallSelection
|
||||
|
||||
End
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user