Skip to content

Commit

Permalink
Minor improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
LiMinggang committed Jun 20, 2016
1 parent 0c98237 commit 19e16e2
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ Known issues:
3. Regular expression which relies on characters before/after the matched string,
Eg. (?<=.)\s(?=.), will has issue to be replaced one by one. It's tricky and
NP++ has the same issue too.
4. HighlightWord would not work if the caret is at the end of the line

Feature/issues to be released
-----------------------------
Expand Down
23 changes: 23 additions & 0 deletions scripts/insertlines.mpy
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#Create MadEdit Object for the active edit
medit = MadEdit()

newline = '\r'
if medit.GetInsertNewLineType() == MadNewLineType.DOS:
newline += '\n'
elif medit.GetInsertNewLineType() == MadNewLineType.Unix:
newline = '\n'

result = InputBox("Please input how many lines you want to insert:", "Input lines")
try:
num = int(result)
if num > 0:
lines = newline * num
medit.InsertStr(lines)
else :
MsgBox("Input Wrong numbers", "ERROR", MadDlgStyle.ICON_ERROR_HAND_STOP | MadDlgStyle.OK)
except:
MsgBox("Input Wrong numbers", "ERROR", MadDlgStyle.ICON_ERROR_HAND_STOP | MadDlgStyle.OK)

print '===='
print lines
print '===='
2 changes: 1 addition & 1 deletion src/MadEdit/MadEdit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ MadEdit::MadEdit( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxS
m_SpellCheck = false;
m_BookmarkInSearch = false;
m_TypewriterMode = m_Config->ReadBool( wxT( "TypewriterMode" ), false );
m_LDClickHighlight = m_Config->ReadBool( wxT( "LDoubleClickHighlight" ), true );
m_LDClickHighlight = m_Config->ReadBool( wxT( "LDoubleClickHighlight" ), true );
m_HasBackup = true;
#ifndef PYMADEDIT_DLL
m_Config->Read( wxT( "SpellCheck" ), &m_SpellCheck, true );
Expand Down

0 comments on commit 19e16e2

Please sign in to comment.