This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 269262
Collapse All | Expand All

(-)a/editor.lib2/src/org/netbeans/api/editor/caret/EditorCaret.java (-1 / +15 lines)
Lines 1868-1876 Link Here
1868
                newAtomicDoc.addAtomicLockListener(listenerImpl);
1868
                newAtomicDoc.addAtomicLockListener(listenerImpl);
1869
            }
1869
            }
1870
1870
1871
            // #269262 when IME is used, deinstall and install method is invoked
1872
            // so in such case, the existing position shoud be used
1873
            // because newDoc.StartPosition() may be an incorrect position
1874
            CaretInfo lastCaret = getLastCaret();
1875
            Position dotPos = lastCaret.getDotPosition();
1876
            if (dotPos == null) {
1877
                dotPos = newDoc.getStartPosition();
1878
            }
1879
1871
            // Set caret to zero position upon document change (DefaultCaret impl does this too)
1880
            // Set caret to zero position upon document change (DefaultCaret impl does this too)
1872
            runTransaction(CaretTransaction.RemoveType.REMOVE_ALL_CARETS, 0,
1881
            runTransaction(CaretTransaction.RemoveType.REMOVE_ALL_CARETS, 0,
1873
                    new CaretItem[] { new CaretItem(this, newDoc.getStartPosition(), Position.Bias.Forward,
1882
                    new CaretItem[] { new CaretItem(this, dotPos, Position.Bias.Forward,
1874
                            null, Position.Bias.Forward ) }, null);
1883
                            null, Position.Bias.Forward ) }, null);
1875
            
1884
            
1876
            // Leave caretPos and markPos null => offset==0
1885
            // Leave caretPos and markPos null => offset==0
Lines 1902-1907 Link Here
1902
                        } finally {
1911
                        } finally {
1903
                            doc.readUnlock();
1912
                            doc.readUnlock();
1904
                        }
1913
                        }
1914
                    } else {
1915
                        // #269262 avoid that update() is not invoked
1916
                        synchronized (listenerList) {
1917
                            caretUpdatePending = false;
1918
                        }
1905
                    }
1919
                    }
1906
                }
1920
                }
1907
            };
1921
            };

Return to bug 269262