(absPath string)
| 183 | } |
| 184 | |
| 185 | func (w *Watcher) commentsNotePath(absPath string) (string, bool) { |
| 186 | rel := w.relativePath(absPath) |
| 187 | if !strings.HasPrefix(rel, noteCommentsPrefix) || !strings.HasSuffix(rel, noteCommentsSuffix) { |
| 188 | return "", false |
| 189 | } |
| 190 | return strings.TrimSuffix(strings.TrimPrefix(rel, noteCommentsPrefix), noteCommentsSuffix), true |
| 191 | } |
| 192 | |
| 193 | func (w *Watcher) handle(ev fsnotify.Event) { |
| 194 | base := filepath.Base(ev.Name) |