Skip to content

Commit

Permalink
Update cache only when value is different
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocobo1 committed Aug 25, 2018
1 parent 3d0d054 commit 17c443c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,11 @@ extern "C" NPPAUTODETECTINDENT_API void beNotified(SCNotification *notifyCode)

TCHAR newPath[MAX_PATH + 1] {};
myPlugin->message()->sendNppMessage<>(NPPM_GETFULLCURRENTPATH, MAX_PATH, reinterpret_cast<LPARAM>(newPath));
indentCache[newPath] = indentCache[oldPath];
indentCache.erase(oldPath);
if (newPath != oldPath)
{
indentCache[newPath] = indentCache[oldPath];
indentCache.erase(oldPath);
}
break;
}

Expand Down
2 changes: 1 addition & 1 deletion src/nppAutoDetectIndent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include "settings.h"

#define PLUGIN_VERSION "1.6"
#define PLUGIN_VERSION "1.7"

namespace
{
Expand Down

0 comments on commit 17c443c

Please sign in to comment.