Skip to content

Commit

Permalink
AutoComplete automatically triggers tag expansion (optional setting)
Browse files Browse the repository at this point in the history
Use image for AutoComplete
Improved Settings (Options) dialog
Improve plugin menu
More robust checking for tag insertion conditions
Cleanup includes and header files
Update README
  • Loading branch information
Vince committed Jan 8, 2021
2 parents 34615f0 + 2a04b86 commit 2c40765
Show file tree
Hide file tree
Showing 9 changed files with 201 additions and 1,122 deletions.
281 changes: 152 additions & 129 deletions QuickText.cpp

Large diffs are not rendered by default.

39 changes: 18 additions & 21 deletions QuickText.h
Original file line number Diff line number Diff line change
@@ -1,38 +1,33 @@
/*
* SYSTEM INCLUDES
*/
#include <sstream>
#include <stdlib.h>
#include "resource.h"
#include "lib/INIMap.h"
#include "menuCmdID.h"
#include "PluginInterface.h"
#include "lib/IniFile.h"
#include "lib/QTString.h"
// #include "sqlite3/CppSQLite3.h"
#ifndef QUICKTEXT_H
#define QUICKTEXT_H

#include <string>
#include <vector>
#include "lib/INIMap.h"
//////////////////////////////////////////////////////////////////////////
/*
* Prototypes
*/
//////////////////////////////////////////////////////////////////////////

using namespace std;
typedef const string cstring;

void QuickText();
HWND getCurrentHScintilla();
std::string wstrtostr( const std::wstring & );
void _refreshINIFiles();
void refreshINIMap();
void openConfigFile();
void openTagsFile();
void jump( HWND &scintilla );
void jump( HWND );
void clear();
void loadConfig();
bool restoreKeyStroke( int cursorPos, HWND &scintilla );
HWND &getCurrentHScintilla();
void stripBreaks( string &str, bool doc, cstring &indent );
void revStripBreaks( string &str );
void decodeStr( cstring &str, int start,
string &indent ); // Uses global var cQuickText.
BOOL CALLBACK DlgConfigProc( HWND hwndDlg, UINT message, WPARAM wParam,
LPARAM lParam );
bool restoreKeyStroke( int, HWND );
void stripBreaks( string &, bool, cstring & );
void revStripBreaks( string & );
void decodeStr( cstring &, int ,string & ); // Uses global var cQuickText.
BOOL CALLBACK DlgConfigProc( HWND, UINT, WPARAM, LPARAM );

//////////////////////////////////////////////////////////////////////////
/*
Expand Down Expand Up @@ -64,3 +59,5 @@ HINSTANCE appInstance;
// *** Variables
INIMap tags, tags_replica;
basic_string<TCHAR> tagsFileName;

#endif
19 changes: 11 additions & 8 deletions QuickText.rc
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,21 @@ STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMEN
CAPTION "QuickText"
FONT 8, "Verdana", 400, 0, 0x0
BEGIN
DEFPUSHBUTTON "&OK",IDOK,216,181,36,14
COMBOBOX IDLANG_CB,7,7,74,131,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | CBS_SORT | CBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Tags",IDC_STATIC,7,28,74,139
GROUPBOX "Ta&gs",IDC_STATIC,7,28,74,139
LISTBOX IDTAG,7,44,74,129,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Substitution Text",IDC_STATIC,94,28,202,125
GROUPBOX "&Substitution Text",IDC_STATIC,94,28,202,125
EDITTEXT IDTEXT,94,44,202,129,ES_MULTILINE | ES_AUTOHSCROLL | ES_WANTRETURN | WS_VSCROLL | WS_HSCROLL | NOT WS_TABSTOP
LTEXT "Tag:",IDC_STATIC,94,9,36,8
LTEXT "&Tag:",IDC_STATIC,94,9,36,8
EDITTEXT IDTAGNAME,119,7,76,13,ES_AUTOHSCROLL
PUSHBUTTON "Add/Modify",IDADD,202,7,43,14
PUSHBUTTON "Delete",IDDEL,262,7,34,14
// CONTROL "Smart Copy && Cut (Ctrl+C/X)",IDSMARTEDIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,185,111,10
DEFPUSHBUTTON "OK",IDOK,196,181,36,14
PUSHBUTTON "Cancel",IDCANCEL,260,181,36,14
PUSHBUTTON "Add/Modify",IDADD,202,7,53,14
PUSHBUTTON "&Delete",IDDEL,262,7,34,14
CONTROL "Version",IDC_STATIC,"Static",WS_CHILDWINDOW|WS_VISIBLE|WS_DISABLED|WS_GROUP,10,181,30,11
CONTROL "<a></a>",IDC_STC_VER,"SysLink",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|LWS_TRANSPARENT,40,181,40,11
CONTROL "Auto &Insert Autocomplete",IDC_STATIC,"Static",WS_CHILDWINDOW|WS_VISIBLE|WS_GROUP,106,181,100,11
CONTROL "",IDC_CHK_AIA,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|BS_AUTOCHECKBOX,94,181,10,9
PUSHBUTTON "&Cancel",IDCANCEL,260,181,36,14
END


Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ to the Notepad++ plugins folder:

## Usage

Use the key shortcut to use QuickText tags from within the current
Notepad++ document.
Assign a shortcut key to the Plugins => QuickText => Replace Tag menu to
use QuickText tags from within the current Notepad++ document.

If the Tag insertion hotkey is used and there is no text before it or
no valid expansion for the text before it, the Tag insertion hotkey
Expand Down
Loading

0 comments on commit 2c40765

Please sign in to comment.