File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -1610,7 +1610,20 @@ end
1610
1610
local function RenameNote ()
1611
1611
local oldfile = Pinfo :new ({ filepath = vim .fn .expand (" %:p" ), M .Cfg })
1612
1612
1613
- fileutils .prompt_title (M .Cfg .extension , oldfile .title , function (newname )
1613
+ local oldtitle = oldfile .title
1614
+ local curuuid = " "
1615
+ local escapedsep = M .Cfg .uuid_sep :gsub (" [%(%)%.%%%+%-%*%?%[%^%$%]]" , " %%%1" )
1616
+
1617
+ if M .Cfg .new_note_filename == " uuid-title" then
1618
+ curuuid , oldtitle =
1619
+ oldfile .title :match (" ^(.-)" .. escapedsep .. " (.+)$" )
1620
+ elseif M .Cfg .new_note_filename == " title-uuid" then
1621
+ oldtitle , curuuid =
1622
+ oldfile .title :match (" ^(.+)" .. escapedsep .. " (.-)$" )
1623
+ end
1624
+
1625
+ fileutils .prompt_title (M .Cfg .extension , oldtitle , function (newname )
1626
+ newname = generate_note_filename (curuuid , newname )
1614
1627
local newpath = newname :match (" (.*/)" ) or " "
1615
1628
newpath = M .Cfg .home .. " /" .. newpath
1616
1629
You can’t perform that action at this time.
0 commit comments