Quramy / tsuquyomi

A Vim plugin for TypeScript
http://www.vim.org/scripts/script.php?script_id=5151
1.39k stars 72 forks source link

TsuRenameSymbol breaks when symbol occures twice on same line #259

Closed nextchessmove closed 5 years ago

nextchessmove commented 5 years ago

Given this example source:

interface LongIdentifier { }

function foo(n: LongIdentifier) : LongIdentifier {
  return n;
}

Placing the caret over the first LongIdentifier and running :TsuRenameSymbol to rename LongIdentifier to Foo results in this:

interface Foo { }

function foo(n: Foo) : LongIdentifFoo
  return n;
}

I haven't dug in much to the implementation, but from the looks of it, could applying the changes "rightmost first" fix this?

Thank you for such a great plugin!

Quramy commented 5 years ago

I've fixed via #290