Merge pull request #711 from RaiKoHoff/Dev_RC_fixes

Dev RC Fixes (iii)
This commit is contained in:
Rainer Kottenhoff 2018-10-15 13:49:10 +02:00 committed by GitHub
commit fb46bd1f6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 46 additions and 32 deletions

View File

@ -327,6 +327,8 @@
#define CMD_FULLSCRWINPOS 20050
#define CMD_DEFAULTWINPOS 20051
#define CMD_SAVEASDEFWINPOS 20052
//#define CMD_LEFT 20053
//#define CMD_RIGHT 20054
#define IDM_FILE_NEW 40000
#define IDM_FILE_OPEN 40001
@ -463,7 +465,7 @@
#define IDM_VIEW_SHOWEOLS 40408
#define IDM_VIEW_WORDWRAPSYMBOLS 40409
#define IDM_VIEW_MATCHBRACES 40410
#define IDM_VIEW_HILITECURRENTLINE 40411
#define IDM_VIEW_HIGHLIGHTCURRENTLINE 40411
#define IDM_VIEW_LINENUMBERS 40412
#define IDM_VIEW_MARGIN 40413
#define IDM_VIEW_ZOOMIN 40414

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -59,7 +59,7 @@ using namespace Scintilla;
// *** Oningmo configuration ***
// ============================================================================
const OnigEncoding g_pOnigEncodingType = ONIG_ENCODING_UTF8; // ONIG_ENCODING_ASCII;
constexpr OnigEncoding g_pOnigEncodingType = ONIG_ENCODING_UTF8; // ONIG_ENCODING_ASCII;
static OnigEncoding g_UsedEncodingsTypes[] = { g_pOnigEncodingType };
// ============================================================================
@ -147,16 +147,16 @@ RegexSearchBase *Scintilla::CreateRegexSearch(CharClassify *charClassTable)
*
* Is the character an octal digit?
*/
inline bool IsOctalDigit(char ch)
constexpr bool IsOctalDigit(char ch)
{
return ((ch >= '0') && (ch <= '7'));
}
// ----------------------------------------------------------------------------
/**
* If the character is an hexa digit, get its value.
* If the character is an hex digit, get its value.
*/
inline int GetHexDigit(char ch)
constexpr int GetHexDigit(char ch)
{
if ((ch >= '0') && (ch <= '9')) {
return (ch - '0');

View File

@ -291,7 +291,7 @@ extern "C" int Encoding_CountOf()
// ============================================================================
static int MapCPI2Encoding(const int iNP3Encoding)
constexpr int MapCPI2Encoding(const int iNP3Encoding)
{
if ((iNP3Encoding < 0) || (iNP3Encoding >= Encoding_CountOf())) {
return UNKNOWN_ENCODING; // CPI_NONE, CPI_GET
@ -305,7 +305,7 @@ static int MapCPI2Encoding(const int iNP3Encoding)
static int FindCodePage(const Encoding& encoding)
constexpr int FindCodePage(const Encoding& encoding)
{
int iCodePage = -1;

View File

@ -1283,6 +1283,7 @@ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
case WM_WINDOWPOSCHANGING:
case WM_WINDOWPOSCHANGED:
case WM_TIMER:
case WM_KEYDOWN:
return DefWindowProc(hwnd, umsg, wParam, lParam);
case WM_SYSKEYDOWN:
@ -1296,7 +1297,7 @@ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
}
}
return DefWindowProc(hwnd, umsg, wParam, lParam);
case WM_SYSKEYUP:
if (!(GetAsyncKeyState(VK_MENU) & SHRT_MIN)) // NOT ALT-KEY DOWN
{
@ -2513,13 +2514,10 @@ LRESULT MsgContextMenu(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
return 0LL;
}
//=============================================================================
//
// MsgChangeNotify() - Handles WM_CHANGENOTIFY
//
//
LRESULT MsgChangeNotify(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
UNUSED(wParam);
@ -2892,7 +2890,7 @@ LRESULT MsgInitMenu(HWND hwnd, WPARAM wParam, LPARAM lParam)
i = SciCall_GetLexer();
//EnableCmd(hmenu,IDM_VIEW_AUTOCLOSETAGS,(i == SCLEX_HTML || i == SCLEX_XML));
CheckCmd(hmenu, IDM_VIEW_AUTOCLOSETAGS, Settings.AutoCloseTags /*&& (i == SCLEX_HTML || i == SCLEX_XML)*/);
CheckCmd(hmenu, IDM_VIEW_HILITECURRENTLINE, Settings.HighlightCurrentLine);
CheckCmd(hmenu, IDM_VIEW_HIGHLIGHTCURRENTLINE, Settings.HighlightCurrentLine);
CheckCmd(hmenu, IDM_VIEW_HYPERLINKHOTSPOTS, Settings.HyperlinkHotspot);
CheckCmd(hmenu, IDM_VIEW_SCROLLPASTEOF, Settings.ScrollPastEOF);
@ -4753,7 +4751,7 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
Settings.AutoCloseTags = !Settings.AutoCloseTags;
break;
case IDM_VIEW_HILITECURRENTLINE:
case IDM_VIEW_HIGHLIGHTCURRENTLINE:
Settings.HighlightCurrentLine = !Settings.HighlightCurrentLine;
Style_SetCurrentLineBackground(Globals.hwndEdit, Settings.HighlightCurrentLine);
break;
@ -5144,14 +5142,25 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
}
break;
#if 0
case CMD_LEFT:
//Sci_SendMsgV0(CHARLEFT);
SciCall_GotoPos(SciCall_PositionBefore(SciCall_GetCurrentPos()));
break;
case CMD_RIGHT:
//Sci_SendMsgV0(CHARRIGHT);
SciCall_GotoPos(SciCall_PositionAfter(SciCall_GetCurrentPos()));
break;
#endif
case CMD_CTRLLEFT:
SendMessage(Globals.hwndEdit, SCI_WORDLEFT, 0, 0);
Sci_SendMsgV0(WORDLEFT);
break;
case CMD_CTRLRIGHT:
SendMessage(Globals.hwndEdit, SCI_WORDRIGHT, 0, 0);
Sci_SendMsgV0(WORDRIGHT);
break;
@ -5848,9 +5857,9 @@ LRESULT MsgSysCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
void OpenHotSpotURL(DocPos position, bool bForceBrowser)
{
char const cStyle = SciCall_GetStyleAt(position);
int const iStyleID = Style_GetHotspotStyleID();
if ((int)cStyle != Style_GetHotspotStyleID()) { return; }
if (!SciCall_StyleGetHotspot(Style_GetHotspotStyleID())) { return; }
if (!SciCall_StyleGetHotspot(iStyleID) || (cStyle != (char)iStyleID)) { return; }
// get left most position of style
DocPos pos = position;

View File

@ -130,7 +130,7 @@ BEGIN
"I", IDM_EDIT_SPLITLINES, VIRTKEY, CONTROL, NOINVERT
"I", IDM_FILE_OPENFAV, VIRTKEY, ALT, NOINVERT
"I", IDM_EDIT_TITLECASE, VIRTKEY, CONTROL, ALT, NOINVERT
"I", IDM_VIEW_HILITECURRENTLINE, VIRTKEY, SHIFT, CONTROL, NOINVERT
"I", IDM_VIEW_HIGHLIGHTCURRENTLINE, VIRTKEY, SHIFT, CONTROL, NOINVERT
"J", IDM_EDIT_JOINLINES, VIRTKEY, CONTROL, NOINVERT
"J", IDM_EDIT_JOINLN_NOSP, VIRTKEY, CONTROL, ALT, NOINVERT
"J", IDM_EDIT_JOINLINES_PARA, VIRTKEY, SHIFT, CONTROL, NOINVERT
@ -191,8 +191,10 @@ BEGIN
"Z", IDM_EDIT_UNDO, VIRTKEY, CONTROL, NOINVERT
"Z", IDM_EDIT_STRIP1STCHAR, VIRTKEY, ALT, NOINVERT
"Z", IDM_EDIT_REDO, VIRTKEY, SHIFT, CONTROL, NOINVERT
//VK_LEFT, CMD_LEFT, VIRTKEY, NOINVERT
VK_LEFT, CMD_CTRLLEFT, VIRTKEY, CONTROL, NOINVERT
VK_LEFT, CMD_ALTLEFT, VIRTKEY, ALT, NOINVERT
//VK_RIGHT, CMD_RIGHT, VIRTKEY, NOINVERT
VK_RIGHT, CMD_CTRLRIGHT, VIRTKEY, CONTROL, NOINVERT
VK_RIGHT, CMD_ALTRIGHT, VIRTKEY, ALT, NOINVERT
VK_ADD, IDM_VIEW_ZOOMIN, VIRTKEY, CONTROL, NOINVERT

View File

@ -90,11 +90,12 @@ typedef enum {
STY_INVISIBLE = 16,
STY_READONLY = 17
// MAX = 127
// MAX = (127 - STYLE_LASTPREDEFINED)
// -------^----- => char <-> int casting !!!
}
LexDefaultStyles;
#define _STYLE_GETSTYLEID(ID) ((int)(STYLE_MAX - ID))
#define _STYLE_GETSTYLEID(ID) ((int)((STYLE_LASTPREDEFINED + 1) + ID))
#define Style_GetHotspotStyleID() _STYLE_GETSTYLEID(STY_URL_HOTSPOT)
#define Style_GetInvisibleStyleID() _STYLE_GETSTYLEID(STY_INVISIBLE)
#define Style_GetReadonlyStyleID() _STYLE_GETSTYLEID(STY_READONLY)

View File

@ -27,11 +27,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define UTRINGBUFFER_H
#define UTRINGBUFFER_VERSION 2.0.2
#include <stdlib.h>
#include <string.h>
#include "utarray.h" // for "UT_icd"
typedef struct {
unsigned i; /* index of next available slot; wraps at n */
unsigned n; /* capacity */
@ -39,14 +39,14 @@ typedef struct {
UT_icd icd; /* initializer, copy and destructor functions */
char *d; /* n slots of size icd->sz */
} UT_ringbuffer;
#define utringbuffer_init(a, _n, _icd) do { \
memset(a, 0, sizeof(UT_ringbuffer)); \
(a)->icd = *(_icd); \
(a)->n = (_n); \
if ((a)->n) { (a)->d = (char*)malloc((a)->n * (_icd)->sz); } \
} while(0)
#define utringbuffer_clear(a) do { \
if ((a)->icd.dtor) { \
if ((a)->f) { \
@ -64,42 +64,42 @@ typedef struct {
(a)->i = 0; \
(a)->f = 0; \
} while(0)
#define utringbuffer_done(a) do { \
utringbuffer_clear(a); \
free((a)->d); (a)->d = NULL; \
(a)->n = 0; \
} while(0)
#define utringbuffer_new(a,n,_icd) do { \
a = (UT_ringbuffer*)malloc(sizeof(UT_ringbuffer)); \
utringbuffer_init(a, n, _icd); \
} while(0)
#define utringbuffer_free(a) do { \
utringbuffer_done(a); \
free(a); \
} while(0)
#define utringbuffer_push_back(a,p) do { \
if ((a)->icd.dtor && (a)->f) { (a)->icd.dtor(_utringbuffer_internalptr(a,(a)->i)); } \
if ((a)->icd.copy) { (a)->icd.copy( _utringbuffer_internalptr(a,(a)->i), p); } \
else { memcpy(_utringbuffer_internalptr(a,(a)->i), p, (a)->icd.sz); }; \
if (++(a)->i == (a)->n) { (a)->i = 0; (a)->f = 1; } \
} while(0)
#define utringbuffer_len(a) ((a)->f ? (a)->n : (a)->i)
#define utringbuffer_empty(a) ((a)->i == 0 && !(a)->f)
#define utringbuffer_full(a) ((a)->f != 0)
#define _utringbuffer_real_idx(a,j) ((a)->f ? ((j) + (a)->i) % (a)->n : (j))
#define _utringbuffer_internalptr(a,j) ((void*)((a)->d + ((a)->icd.sz * (j))))
#define utringbuffer_eltptr(a,j) ((0 <= (j) && (j) < utringbuffer_len(a)) ? _utringbuffer_internalptr(a,_utringbuffer_real_idx(a,j)) : NULL)
#define _utringbuffer_fake_idx(a,j) ((a)->f ? ((j) + (a)->n - (a)->i) % (a)->n : (j))
#define _utringbuffer_internalidx(a,e) (((char*)(e) >= (a)->d) ? (((char*)(e) - (a)->d)/(a)->icd.sz) : -1)
#define utringbuffer_eltidx(a,e) _utringbuffer_fake_idx(a, _utringbuffer_internalidx(a,e))
#define utringbuffer_front(a) utringbuffer_eltptr(a,0)
#define utringbuffer_next(a,e) ((e)==NULL ? utringbuffer_front(a) : utringbuffer_eltptr(a, utringbuffer_eltidx(a,e)+1))
#define utringbuffer_prev(a,e) ((e)==NULL ? utringbuffer_back(a) : utringbuffer_eltptr(a, utringbuffer_eltidx(a,e)-1))