PureBasic Forum http://forums.purebasic.com/english/ |
|
[Implemented] More Scintilla IDE shortcuts http://forums.purebasic.com/english/viewtopic.php?f=3&t=52122 |
Page 1 of 1 |
Author: | kenmo [ Sun Nov 18, 2012 4:02 am ] |
Post subject: | [Implemented] More Scintilla IDE shortcuts |
Scintilla has a lot of useful shortcuts, such as Ctrl+D for Duplicate which the PB IDE supports but does not list in the Shortcuts preferences. Now that Scintilla has been updated in PB recently, I would like to see a few more shortcuts supported that I like to use in other editors such as Notepad++: - Move Selection Up (SCI_MOVESELECTEDLINESUP) Ctrl+Shift+Up - Move Selection Down (SCI_MOVESELECTEDLINESDOWN) Ctrl+Shift+Down - Delete Lines (SCI_LINEDELETE) maybe Ctrl+L although this key combo is set to "Recent Line" by default - Find Previous (SCI_SEARCHPREV) Shift+F3 to complement the already-supported F3 Find Next There may be other useful ones too. |
Author: | skywalk [ Mon Jan 07, 2013 6:38 pm ] |
Post subject: | Re: More Scintilla IDE shortcuts |
The following code crashes my v5 IDE ![]() IDE wrote: An error has been detected in the IDE! Error: Invalid memory access IDE build on 11/05/2012 [16:05] by Fred Branch: v4.70 Revision: 1361 Code: ; Compile & assign ct_sci_kybd_FindPrev.exe --> Shorcut = [Shift+F3]
; This becomes the opposite of Find Forward via Shorcut = [F3] Define.i ri, hSci = Val(GetEnvironmentVariable("PB_TOOL_Scintilla")) If hSci SendMessageTimeout_(hSci,#SCI_SEARCHPREV,0,0,#SMTO_ABORTIFHUNG,2000,@ri) EndIf |
Author: | kenmo [ Mon Feb 10, 2020 3:25 pm ] |
Post subject: | Re: [Implemented] More Scintilla IDE shortcuts |
Marking my own post from 2012 as Implemented ![]() Find Previous was added in PB 5.60 Move Lines Up/Down, and Delete Line, merged in Pull Request #54 for upcoming 5.72 https://github.com/fantaisie-software/purebasic/pull/54 |
Author: | skywalk [ Mon Feb 10, 2020 3:58 pm ] |
Post subject: | Re: [Implemented] More Scintilla IDE shortcuts |
Good deal. Since [Crtl+D] = duplicate line, please enable or allow user hotkey choice for [Ctrl+Shift+D] = delete line. |
Author: | kenmo [ Mon Feb 10, 2020 4:10 pm ] |
Post subject: | Re: [Implemented] More Scintilla IDE shortcuts |
They will be user configurable (assuming they make it into 5.72 Final) I kept Ctrl+D as the default for Duplicate, but did not assign a default to Delete Line(s). Ctrl+Shift+D is not currently used for anything..... but I think Fred and Timo get the final decision on default mappings. |
Author: | oreopa [ Mon Feb 10, 2020 5:31 pm ] |
Post subject: | Re: [Implemented] More Scintilla IDE shortcuts |
I don't know if this is in your remit - I'm not sure if Scintilla has this functionality built in, but... 1. Selection to uppercase 2. Selection to lowercase 3. Invert case of selection ...would be nice. I have this already as a self built tool, but it would be nicer native. |
Author: | kenmo [ Mon Feb 10, 2020 6:04 pm ] |
Post subject: | Re: [Implemented] More Scintilla IDE shortcuts |
Scintilla has built-in UPPERCASE and LOWERCASE function: Code: If OpenWindow(0, 0, 0, 330, 90, "ScintillaGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) If InitScintilla() ScintillaGadget(0, 10, 10, 320, 70, 0) *Text=UTF8("Hello World") ScintillaSendMessage(0, #SCI_SETTEXT, 0, *Text) FreeMemory(*Text) ScintillaSendMessage(0, #SCI_SETSEL, 0, 5) ScintillaSendMessage(0, #SCI_UPPERCASE) ScintillaSendMessage(0, #SCI_SETSEL, 6, 11) ScintillaSendMessage(0, #SCI_LOWERCASE) ScintillaSendMessage(0, #SCI_SETSEL, 0, 0) Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow EndIf EndIf For invert case, you mean "Hello" --> "hELLO" ? That would be easy too: Code: Procedure.s InvertCase(Text.s)
Protected *C.CHARACTER = @Text While (*C\c) If (*C\c = Asc(LCase(Chr(*C\c)))) *C\c = Asc(UCase(Chr(*C\c))) Else *C\c = Asc(LCase(Chr(*C\c))) EndIf *C + SizeOf(CHARACTER) Wend ProcedureReturn Text EndProcedure Debug InvertCase("123 Hello!") Debug InvertCase(InvertCase("123 Hello!")) |
Author: | skywalk [ Mon Feb 10, 2020 6:31 pm ] |
Post subject: | Re: [Implemented] More Scintilla IDE shortcuts |
Nice, where do we submit our IDE tool code to be converted to Native IDE? Here on the forum or in the github? I have several other functions I use. |
Author: | oreopa [ Mon Feb 10, 2020 6:51 pm ] |
Post subject: | Re: [Implemented] More Scintilla IDE shortcuts |
kenmo wrote: Scintilla has built-in UPPERCASE and LOWERCASE function... Actually I don't believe I forgot that, because its those functions I use in my usertool ![]() kenmo wrote: For invert case, you mean "Hello" --> "hELLO" ? Exactly. Anyway, IDE native would be great if possible ![]() |
Author: | kenmo [ Tue Feb 11, 2020 3:32 pm ] |
Post subject: | Re: [Implemented] More Scintilla IDE shortcuts |
I think you can request IDE features on the forum or GitHub... I started a GitHub topic for new shortcuts / menu actions... https://github.com/fantaisie-software/p ... /issues/46 I can't guarantee they'll get done... right now I'm converting my own IDE tools to native features... and starting with the easier ones like Scintilla shortcuts. You are also free to download the IDE project and experiment yourself (it's fun and good practice!) ![]() Funny, about UPPERCASE and LOWERCASE, I just tried them in the IDE thinking it would be simple. It works on variables, comments, etc. But because of the IDE's Very Aggressive CaseCorrection, it does not change keywords or built-in functions. Case Correction is currently built into the highlighting, not just typing events. So it goes UPPERCASE action --> rehighlight --> case correct --> instantly back to regular case! |
Author: | skywalk [ Tue Feb 11, 2020 4:59 pm ] |
Post subject: | Re: [Implemented] More Scintilla IDE shortcuts |
Unfortunately, no time to load and review the IDE flow. These are some of my goto tools. I can PM you the source code if you think they are worthy of adding to the repo? FINDDEF - is still a work in progress. Code: ; ToolName Arguments Shortcut Description
; ---------------------- ---------------------- ----------------- ----------------------------------------------------------- ; CLOSE_EXTRA_PB_WINDOWS CLOSE_EXTRA_PB_WINDOWS [Ctrl+0] Close extra windows like debug,help,variable,etc. ; INDENTALL INDENTALL [Ctrl+Shift+i] Select All characters, then trigger indent function. ; PASTECOMMENT PASTECOMMENT [Ctrl+Shift+v] Paste text as comment to avoid syntax changes. ; COPYALL COPYALL [Ctrl+Shift+k] Select All characters, then copy to clipboard. ; UCASE UCASE [Ctrl+u] ; LCASE LCASE [Ctrl+Shift+u] Opposite of UCase line = [Ctrl+u] ; LINEDEL LINEDEL [Ctrl+Shift+d] Opposite of duplicate line = [Ctrl+d] ; MVLINESUP MVLINESUP [Ctrl+Shift+Up] ; MVLINESDN MVLINESDN [Ctrl+Shift+Down] ; TRIM_LINES NONE [Ctrl+t] Trim whitespace only lines and trailing whitespace. ; ECHO ECHO [Ctrl+Shift+1] Reports word under cursor ; HILITE HILITE [Ctrl+`] Unhilite works by applying shortcut to white space. ; WORDCOUNT_THISLINE WORDCOUNT_THISLINE [Ctrl+1] Count of specific character in current line. ; FINDDEF FINDDEF [Ctrl+2] Jump to best guess at keyword(kw) definition/instantiation: ; GETASM-X86 GETASM-X86 %FILE None %FILE = full path + filename. Adds a datetime stamp to end to avoid overwrites. ; GETASM-X64 GETASM-X64 %FILE None %FILE = full path + filename. Adds a datetime stamp to end to avoid overwrites. ; GETENV GETENV None |
Page 1 of 1 | All times are UTC + 1 hour |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |