File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -67,10 +67,19 @@ class TitleTextField: NSTextField {
6767
6868 let currentName = note. getFileName ( )
6969 let ext = note. url. pathExtension
70- let dst = note. project. url. appendingPathComponent ( currentTitle) . appendingPathExtension ( ext)
70+ let fileName =
71+ currentTitle
72+ . trimmingCharacters ( in: CharacterSet . whitespaces)
73+ . replacingOccurrences ( of: " : " , with: " - " )
74+ . replacingOccurrences ( of: " / " , with: " : " )
75+
76+ let dst = note. project. url
77+ . appendingPathComponent ( fileName)
78+ . appendingPathExtension ( ext)
7179
7280 if !FileManager. default. fileExists ( atPath: dst. path) , note. move ( to: dst) {
73- vc. updateTitle ( newTitle: currentTitle)
81+ let newTitle = currentTitle. replacingOccurrences ( of: " : " , with: " - " )
82+ vc. updateTitle ( newTitle: newTitle)
7483
7584 updateNotesTableView ( )
7685 } else {
You can’t perform that action at this time.
0 commit comments