It is currently Wed Feb 19, 2020 10:35 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: [Implemented] More Scintilla IDE shortcuts
PostPosted: Sun Nov 18, 2012 4:02 am 
Offline
Addict
Addict
User avatar

Joined: Tue Dec 23, 2003 3:54 am
Posts: 1732
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.

_________________
On GitHub: PB Includes - IDE Tools - Color Themes


Last edited by kenmo on Mon Feb 10, 2020 3:21 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: More Scintilla IDE shortcuts
PostPosted: Mon Jan 07, 2013 6:38 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Dec 23, 2009 10:14 pm
Posts: 3203
Location: Boston, MA
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

_________________
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum


Top
 Profile  
Reply with quote  
 Post subject: Re: [Implemented] More Scintilla IDE shortcuts
PostPosted: Mon Feb 10, 2020 3:25 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Dec 23, 2003 3:54 am
Posts: 1732
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

_________________
On GitHub: PB Includes - IDE Tools - Color Themes


Top
 Profile  
Reply with quote  
 Post subject: Re: [Implemented] More Scintilla IDE shortcuts
PostPosted: Mon Feb 10, 2020 3:58 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Dec 23, 2009 10:14 pm
Posts: 3203
Location: Boston, MA
Good deal.
Since [Crtl+D] = duplicate line, please enable or allow user hotkey choice for [Ctrl+Shift+D] = delete line.

_________________
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum


Top
 Profile  
Reply with quote  
 Post subject: Re: [Implemented] More Scintilla IDE shortcuts
PostPosted: Mon Feb 10, 2020 4:10 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Dec 23, 2003 3:54 am
Posts: 1732
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.

_________________
On GitHub: PB Includes - IDE Tools - Color Themes


Top
 Profile  
Reply with quote  
 Post subject: Re: [Implemented] More Scintilla IDE shortcuts
PostPosted: Mon Feb 10, 2020 5:31 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Jun 24, 2006 3:29 am
Posts: 208
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.

_________________
Proud supporter of PB! * Musician * C64/6502 Freak


Top
 Profile  
Reply with quote  
 Post subject: Re: [Implemented] More Scintilla IDE shortcuts
PostPosted: Mon Feb 10, 2020 6:04 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Dec 23, 2003 3:54 am
Posts: 1732
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!"))

_________________
On GitHub: PB Includes - IDE Tools - Color Themes


Top
 Profile  
Reply with quote  
 Post subject: Re: [Implemented] More Scintilla IDE shortcuts
PostPosted: Mon Feb 10, 2020 6:31 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Dec 23, 2009 10:14 pm
Posts: 3203
Location: Boston, MA
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.

_________________
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum


Top
 Profile  
Reply with quote  
 Post subject: Re: [Implemented] More Scintilla IDE shortcuts
PostPosted: Mon Feb 10, 2020 6:51 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Jun 24, 2006 3:29 am
Posts: 208
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 ;)

_________________
Proud supporter of PB! * Musician * C64/6502 Freak


Top
 Profile  
Reply with quote  
 Post subject: Re: [Implemented] More Scintilla IDE shortcuts
PostPosted: Tue Feb 11, 2020 3:32 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Dec 23, 2003 3:54 am
Posts: 1732
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!

_________________
On GitHub: PB Includes - IDE Tools - Color Themes


Top
 Profile  
Reply with quote  
 Post subject: Re: [Implemented] More Scintilla IDE shortcuts
PostPosted: Tue Feb 11, 2020 4:59 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Dec 23, 2009 10:14 pm
Posts: 3203
Location: Boston, MA
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

_________________
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye