Skip to content

Commit

Permalink
Better management for Tab tag-key, autoclose autocompletion window
Browse files Browse the repository at this point in the history
removed binaries, updated .gitignore
  • Loading branch information
Vince committed Feb 7, 2020
1 parent 024669b commit 250ce0c
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 18 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ tags
*.iobj
*.ipdb
*.user
*.zip
*.zip
bin/*
bin64/*
32 changes: 18 additions & 14 deletions QuickText.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,8 @@ void QuickText()
SendMessage( scintilla, SCI_REPLACESEL, 0,
( LPARAM )cQuickText.text.c_str() );

SendMessage( scintilla, SCI_AUTOCCANCEL, 0, 0 );

cQuickText.editing = true;

cQuickText.cHotSpot = NEW_HOTSPOT;
Expand Down Expand Up @@ -1045,20 +1047,22 @@ bool restoreKeyStroke( int cursorPos, HWND &scintilla )
CHAR buf[101]; // Because N++ allows 99 as max tab-to-space conversion
if ( sk._key == VK_TAB )
{
bool useTabs = ::SendMessage( scintilla, SCI_GETUSETABS, 0, 0 );
if ( useTabs )
{
sprintf( buf, "%c", sk._key );
::SendMessage( scintilla, SCI_REPLACESEL, cursorPos, ( LPARAM )buf );
}
else
{
int tabSpace = ::SendMessage( scintilla, SCI_GETTABWIDTH, 0, 0 );
for (int i = 0; ((i < tabSpace) && (i<100)); i++)
buf[i] = ' ';
buf[tabSpace] = '\0';
::SendMessage( scintilla, SCI_REPLACESEL, cursorPos, ( LPARAM )buf );
}
SendMessage( scintilla, SCI_TAB, 0, 0 );

// bool useTabs = ::SendMessage( scintilla, SCI_GETUSETABS, 0, 0 );
// if ( useTabs )
// {
// sprintf( buf, "%c", sk._key );
// ::SendMessage( scintilla, SCI_REPLACESEL, cursorPos, ( LPARAM )buf );
// }
// else
// {
// int tabSpace = ( int )::SendMessage( scintilla, SCI_GETTABWIDTH, 0, 0 );
// for (int i = 0; ((i < tabSpace) && (i<100)); i++)
// buf[i] = ' ';
// buf[tabSpace] = '\0';
// ::SendMessage( scintilla, SCI_REPLACESEL, cursorPos, ( LPARAM )buf );
// }
}
else
{
Expand Down
6 changes: 3 additions & 3 deletions QuickText.rc
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,1,1,1
PRODUCTVERSION 0,1,1,1
FILEVERSION 0,1,2,1
PRODUCTVERSION 0,1,2,1
FILEFLAGSMASK 0x17L
#define VER_STRING "0.1.1.1"
#define VER_STRING "0.1.2.1"
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
Expand Down
Binary file removed bin/QuickText.dll
Binary file not shown.
Binary file removed bin64/QuickText.dll
Binary file not shown.

0 comments on commit 250ce0c

Please sign in to comment.