Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CUP Eclipse Plugin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dr. Michael Petter
CUP Eclipse Plugin
Commits
a2e434c1
Commit
a2e434c1
authored
Nov 28, 2014
by
Johannes Roith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make renaming a compound change (undo by clicking undo once).
parent
7e1cff33
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
CupPlugin/src/de/tum/in/www2/cupplugin/commands/RenameSymbolHandler.java
...e/tum/in/www2/cupplugin/commands/RenameSymbolHandler.java
+3
-0
CupPlugin/src/de/tum/in/www2/cupplugin/editors/CupTextEditor.java
...n/src/de/tum/in/www2/cupplugin/editors/CupTextEditor.java
+9
-0
No files found.
CupPlugin/src/de/tum/in/www2/cupplugin/commands/RenameSymbolHandler.java
View file @
a2e434c1
...
...
@@ -195,8 +195,11 @@ public class RenameSymbolHandler extends AbstractHandler {
return
null
;
}
editor
.
beginCompoundChange
();
RenamingVisitor
visitor
=
new
RenamingVisitor
(
doc
,
oldName
,
renameDialog
.
getNewName
());
ast
.
accept
(
visitor
,
null
);
editor
.
endCompoundChange
();
}
}
...
...
CupPlugin/src/de/tum/in/www2/cupplugin/editors/CupTextEditor.java
View file @
a2e434c1
...
...
@@ -12,6 +12,7 @@ import org.eclipse.jface.text.BadLocationException;
import
org.eclipse.jface.text.IDocument
;
import
org.eclipse.jface.text.source.ISourceViewer
;
import
org.eclipse.jface.text.source.IVerticalRulerInfo
;
import
org.eclipse.jface.text.source.SourceViewer
;
import
org.eclipse.swt.custom.StyledText
;
import
org.eclipse.swt.graphics.Color
;
import
org.eclipse.swt.widgets.Display
;
...
...
@@ -109,6 +110,14 @@ public class CupTextEditor extends TextEditor
}
}
public
void
beginCompoundChange
()
{
((
SourceViewer
)
getSourceViewer
()).
getUndoManager
().
beginCompoundChange
();
}
public
void
endCompoundChange
()
{
((
SourceViewer
)
getSourceViewer
()).
getUndoManager
().
endCompoundChange
();
}
public
IDocument
getDocument
()
{
IDocumentProvider
provider
=
getDocumentProvider
();
if
(
provider
!=
null
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment