diff options
Diffstat (limited to 'script-beta/core')
-rw-r--r-- | script-beta/core/rename.lua | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/script-beta/core/rename.lua b/script-beta/core/rename.lua index 8410c04f..40104389 100644 --- a/script-beta/core/rename.lua +++ b/script-beta/core/rename.lua @@ -5,6 +5,7 @@ local proto = require 'proto' local define = require 'proto.define' local util = require 'utility' local findSource = require 'core.find-source' +local ws = require 'workspace' local Forcing @@ -389,15 +390,20 @@ function m.rename(uri, pos, newname) local mark = {} rename(source, newname, function (target, start, finish, text) - if mark[start] then + local turi = files.getOriginUri(guide.getUri(target)) + local uid = turi .. start + if mark[uid] then + return + end + mark[uid] = true + if ws.isLibrary(turi) then return end - mark[start] = true results[#results+1] = { start = start, finish = finish, text = text, - uri = files.getOriginUri(guide.getUri(target)), + uri = turi, } end) |