Skip to content

Commit

Permalink
Add autocomplete icon
Browse files Browse the repository at this point in the history
  • Loading branch information
VinsWorldcom committed Dec 8, 2023
1 parent 090d7fd commit ba96532
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/GTags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,40 @@ constexpr int MIN_NOTEPADPP_VERSION = ((MIN_NOTEPADPP_VERSION_MAJOR << 16) | MIN
std::unique_ptr<CPath> ChangedFile;
bool DeInitCOM = false;

#define STR_HELPER(x) #x
#define STR(x) STR_HELPER(x)
#define REGIMGIDL 21580
const char *xpmGtL[] = {
/* columns rows colors chars-per-pixel */
"16 16 9 1 ",
" c #0f0f0f",
". c #800000",
"X c red",
"o c #008000",
"O c green",
"+ c navy",
"@ c blue",
"# c #808080",
"$ c None",
/* pixels */
"$$$$ $$$$$$$$$$$",
"$$$ O $$$$$$$$$$",
"$$ OOO $$$$$$$$$",
"$ OOOoo $$$$$ $$",
" OOOoo $$$$$ X $",
"$ Ooo ##### X.. ",
"$$ o $$$#$ X.. $",
"$$$ $$$$#$$ . $$",
"$$$$$$$$#$$$ $$$",
"$$$$$$$$#$$$$$$$",
"$$$$$$$$#$$$ $$$",
"$$$$$$$$### @ $$",
"$$$$$$$$$$ @++ $",
"$$$$$$$$$ @++ $$",
"$$$$$$$$$$ + $$$",
"$$$$$$$$$$$ $$$$"
};


/**
* \brief
Expand Down Expand Up @@ -305,13 +339,17 @@ void sciAutoComplCB(const CmdPtr_t& cmd)
for (const auto& complEntry : cmd->Parser()->GetList())
{
wList += ws2s(complEntry).c_str();
wList += '\x1E';
wList += STR(REGIMGIDL);
i++;
if (i < size)
wList += " ";
}

SendMessage(INpp::Get().GetSciHandle(), SCI_AUTOCSETSEPARATOR, ' ', 0);
SendMessage(INpp::Get().GetSciHandle(), SCI_AUTOCSETTYPESEPARATOR, WPARAM('\x1E'), 0 );
SendMessage(INpp::Get().GetSciHandle(), SCI_AUTOCSETIGNORECASE, true, 0);
SendMessage(INpp::Get().GetSciHandle(), SCI_REGISTERIMAGE, REGIMGIDL, (LPARAM)xpmGtL);
SendMessage(INpp::Get().GetSciHandle(), SCI_AUTOCSHOW, cmd->Tag().Len(), (LPARAM) wList.c_str());

return;
Expand Down

0 comments on commit ba96532

Please sign in to comment.