Skip to content

Commit 17c443c

Browse files
committed
Update cache only when value is different
1 parent 3d0d054 commit 17c443c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/dllmain.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,11 @@ extern "C" NPPAUTODETECTINDENT_API void beNotified(SCNotification *notifyCode)
101101

102102
TCHAR newPath[MAX_PATH + 1] {};
103103
myPlugin->message()->sendNppMessage<>(NPPM_GETFULLCURRENTPATH, MAX_PATH, reinterpret_cast<LPARAM>(newPath));
104-
indentCache[newPath] = indentCache[oldPath];
105-
indentCache.erase(oldPath);
104+
if (newPath != oldPath)
105+
{
106+
indentCache[newPath] = indentCache[oldPath];
107+
indentCache.erase(oldPath);
108+
}
106109
break;
107110
}
108111

src/nppAutoDetectIndent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
#include "settings.h"
2323

24-
#define PLUGIN_VERSION "1.6"
24+
#define PLUGIN_VERSION "1.7"
2525

2626
namespace
2727
{

0 commit comments

Comments
 (0)