[hg] main-silver: #208318 - Last Edit Location isn't updated by ...

  • From: Milutin Kristofic < >
  • To:
  • Subject: [hg] main-silver: #208318 - Last Edit Location isn't updated by ...
  • Date: Wed, 06 Feb 2013 13:58:29 -0800

changeset 6403304e5f6b in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/6403304e5f6b
description:
        #208318 - Last Edit Location isn't updated by search-and-replace

diffstat:

 editor.search/nbproject/project.xml                                         
|   2 +-
 editor.search/src/org/netbeans/modules/editor/search/EditorFindSupport.java 
|  11 ++++++++++
 2 files changed, 12 insertions(+), 1 deletions(-)

diffs (47 lines):

diff --git a/editor.search/nbproject/project.xml 
b/editor.search/nbproject/project.xml
--- a/editor.search/nbproject/project.xml
+++ b/editor.search/nbproject/project.xml
@@ -37,7 +37,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>3</release-version>
-                        <specification-version>3.36.0</specification-version>
+                        <implementation-version/>
                     </run-dependency>
                 </dependency>
                 <dependency>
diff --git 
a/editor.search/src/org/netbeans/modules/editor/search/EditorFindSupport.java 
b/editor.search/src/org/netbeans/modules/editor/search/EditorFindSupport.java
--- 
a/editor.search/src/org/netbeans/modules/editor/search/EditorFindSupport.java
+++ 
b/editor.search/src/org/netbeans/modules/editor/search/EditorFindSupport.java
@@ -69,6 +69,7 @@
 import org.netbeans.api.editor.mimelookup.MimePath;
 import org.netbeans.api.editor.settings.FontColorNames;
 import org.netbeans.api.editor.settings.SimpleValueNames;
+import org.netbeans.modules.editor.lib.NavigationHistory;
 import org.netbeans.modules.editor.lib2.ComponentUtils;
 import org.netbeans.modules.editor.lib2.DocUtils;
 import org.netbeans.modules.editor.lib2.highlighting.BlockHighlighting;
@@ -683,6 +684,11 @@
                     doc.remove(startOffset, len);
                 }
                 if (s != null && s.length() > 0) {
+                    try {
+                        NavigationHistory.getEdits().markWaypoint(c, 
startOffset, false, true);
+                    } catch (BadLocationException e) {
+                        LOG.log(Level.WARNING, "Can't add position to the 
history of edits.", e); //NOI18N
+                    }
                     doc.insertString(startOffset, s, null);
                     if (startOffset == blockSearchStartOffset) { // Replaced 
at begining of block
                         blockSearchStartPos = 
doc.createPosition(startOffset);
@@ -801,6 +807,11 @@
                     } else { // can and will insert the new string
                         if (replaceWith != null && replaceWith.length() > 0) 
{
                             int offset = blk[0];
+                            try {
+                                NavigationHistory.getEdits().markWaypoint(c, 
offset, false, true);
+                            } catch (BadLocationException e) {
+                                LOG.log(Level.WARNING, "Can't add position 
to the history of edits.", e); //NOI18N
+                            }
                             doc.insertString(offset, replaceWith, null);
                             if (offset == blockSearchStartOffset) { // 
Replaced at begining of block
                                 blockSearchStartPos = 
doc.createPosition(offset);

[hg] main-silver: #208318 - Last Edit Location isn't updated by ...

Milutin Kristofic 02/06/2013

Project Features

About this Project

Editor was started in November 2009, is owned by Martin Ryzl, and has 147 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close