| 666 | } |
| 667 | |
| 668 | void ZepBuffer::SetFilePath(const fs::path& path) { |
| 669 | auto testPath = path; |
| 670 | if (GetEditor().GetFileSystem().Exists(testPath)) { |
| 671 | testPath = GetEditor().GetFileSystem().Canonical(testPath); |
| 672 | } else { |
| 673 | if (!path.is_absolute()) { |
| 674 | auto full = GetEditor().GetFileSystem().GetWorkingDirectory() / path; |
| 675 | if (GetEditor().GetFileSystem().Exists(full)) { |
| 676 | testPath = GetEditor().GetFileSystem().Canonical(full); |
| 677 | } else { |
| 678 | testPath = full; |
| 679 | } |
| 680 | } |
| 681 | } |
| 682 | |
| 683 | if (!GetEditor().GetFileSystem().Equivalent(testPath, m_filePath)) { |
| 684 | m_filePath = testPath; |
| 685 | } |
| 686 | GetEditor().SetBufferSyntax(*this); |
| 687 | } |
| 688 | |
| 689 | // Remember that we updated the buffer and dirty the state |
| 690 | // Clients can use these values to figure out update times and dirty state |
no test coverage detected