identifier renaming, reproduce DCD behavior at word edges

This commit is contained in:
Basile Burg 2016-05-04 23:52:06 +02:00
parent f2ec6823e9
commit 361e5728b8
1 changed files with 4 additions and 1 deletions

View File

@ -1015,12 +1015,15 @@ end;
procedure TCESynMemo.renameIdentifier; procedure TCESynMemo.renameIdentifier;
var var
locs: TIntOpenArray = nil; locs: TIntOpenArray = nil;
old, idt: string; old, idt, line: string;
i, j, loc: integer; i, j, loc: integer;
c: char; c: char;
begin begin
if not DcdWrapper.available then if not DcdWrapper.available then
exit; exit;
line := lineText;
if (CaretX = 1) or not (line[LogicalCaretXY.X] in IdentChars) or
not (line[LogicalCaretXY.X-1] in IdentChars) then exit;
old := GetWordAtRowCol(LogicalCaretXY); old := GetWordAtRowCol(LogicalCaretXY);
DcdWrapper.getLocalSymbolUsageFromCursor(locs); DcdWrapper.getLocalSymbolUsageFromCursor(locs);
if length(locs) = 0 then if length(locs) = 0 then