BugFix Posted May 24, 2013 Share Posted May 24, 2013 (edited) I've an unexpected behavior by selections in SciTE. The following script causes, the word under the cursor is selected. This can either apply to the Word character (by pressing Ctrl + Shift + E) or additionally with leading "$" for variables (by pressing Ctrl + E). This works perfectly - as long as the right of the term is a space. If this is not so, then ranges are selected that do not correspond to the markers. Incidentally, it does not matter how I run the selection ( Selection Start / Stop; SetSel (); CharRightExtend () ), always the same behavior. Any Ideas.. Edit: Have found the failure - by default use SciTe "Ctrl+E" to match next brace. No i've changed the hotkey and it works like expected. ------------------------------------------------------------------------- EditKey = EventClass:new(Common) ------------------------------------------------------------------------- ------------------------------------------------------------------------- -- expand selection to full variable ($variable) or only the word characters (variable) ---------------- SetSelection( ) ----------------------------------------- function SetSelection(_part) local isWordChar = function(_char) if string.char(_char):find('[a-zA-Z0-9_]') then return true end return false end local iStart = editor.CurrentPos local iEnd = iStart while isWordChar(editor.CharAt[iStart-1]) do iStart = iStart - 1 end if string.char(editor.CharAt[iStart-1]) == "$" and _part == false then iStart = iStart - 1 end while isWordChar(editor.CharAt[iEnd]) do iEnd = iEnd + 1 end if iStart ~= iEnd then editor.SelectionStart = iStart editor.SelectionEnd = iEnd end end -->SetSelection ------------------------------------------------------------------------- ----------------- Event: OnKey ----------------------------------------- function EditKey:OnKey(_keycode, _shift, _ctrl, _alt) if _ctrl and _shift and not _alt and _keycode == 69 then SetSelection(true) end --- expand selection to full word with only Wordcharacters if _ctrl and not _shift and not _alt and _keycode == 69 then SetSelection(false) end --- expand selection to full word with Wordcharacters and leading "$" return nil end --> EditKey ------------------------------------------------------------------------- Edited May 25, 2013 by BugFix Best Regards BugFix Link to comment Share on other sites More sharing options...
Developers Jos Posted May 25, 2013 Developers Share Posted May 25, 2013 Edit: Have found the failure - by default use SciTe "Ctrl+E" to match next brace. No i've changed the hotkey and it works like expected. I was just about to have a look and saw you also posted this question in the SciTE-Interest group. Good to see it was solved. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
BugFix Posted May 25, 2013 Author Share Posted May 25, 2013 I'm a little bit confused - it may be 1 or 2 hours after posting in Google groups, than i detected the solution by myself. Instantly i have deleted the post in Google groups. Where have you found this post now? I cant find them in the time line. I've now seen, that Neil has also answered. Exists a copy of any posting there also if it is deleted? Best Regards BugFix Link to comment Share on other sites More sharing options...
guinness Posted May 26, 2013 Share Posted May 26, 2013 Maybe it was still in the RSS feed? UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
BugFix Posted May 26, 2013 Author Share Posted May 26, 2013 Info from Neil: It will be remembered forever here: http://blog.gmane.org/gmane.editors.scite.general And it was sent also a email notification for new entries. (I've also selected this feature ) Best Regards BugFix Link to comment Share on other sites More sharing options...
Developers Jos Posted May 26, 2013 Developers Share Posted May 26, 2013 (edited) I get an email with all-new-posts-of-the-day, for both SciTE and Scintilla, and saw it in there. Jos Edited May 26, 2013 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now