Skip to content

Commit 14451c6

Browse files
committed
update
1 parent daaf9e2 commit 14451c6

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lua/dired/init.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,13 +1397,14 @@ Browser.applyChanges = function(state)
13971397

13981398
-- rename
13991399
local curline = api.nvim_win_get_cursor(state.win)[1]
1400+
local curtext = buffer_lines[curline]:gsub('%s+', '')
14001401
if
14011402
state.entries[curline]
1402-
and not vim.startswith(state.entries[curline].name, buffer_lines[curline])
1403+
and curtext ~= state.entries[curline].name
14031404
and #buffer_lines == #state.entries
14041405
then
14051406
local old = state.entries[curline].name
1406-
local new = buffer_lines[curline]:gsub('%s+', '')
1407+
local new = curtext
14071408
local old_name = old:gsub(SEPARATOR .. '$', '')
14081409
local new_name = new:gsub(SEPARATOR .. '$', '')
14091410

0 commit comments

Comments
 (0)