It is currently Sun Jan 24, 2021 11:17 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: IDE - Delete line under cursor
PostPosted: Thu Feb 11, 2016 4:47 pm 
Offline
Addict
Addict

Joined: Sat Feb 08, 2014 3:26 pm
Posts: 966
Hi Fred,

A (long time) feature request in IDE: Edition / Delete Line (under cursor)
Yes, there are many patches, but these are patches :|
Remove entire line where cursor is, is very useful for fast code maintenance :!:

:idea: Do not set any shortcut: Let the user set the shortcut he wants to please everybody :wink:


Top
 Profile  
Reply with quote  
 Post subject: Re: IDE - Delete line under cursor
PostPosted: Thu Feb 11, 2016 4:57 pm 
Offline
Moderator
Moderator

Joined: Thu Dec 31, 2009 11:05 pm
Posts: 1113
Location: Gernsbach (Germany)
Alternative:
1. Press End key
2. Press Ctrl + Shift + Back key

_________________
ImageImageImageImage Image


Top
 Profile  
Reply with quote  
 Post subject: Re: IDE - Delete line under cursor
PostPosted: Thu Feb 11, 2016 5:07 pm 
Offline
Addict
Addict

Joined: Sat Feb 08, 2014 3:26 pm
Posts: 966
RSBasic wrote:
Alternative:
1. Press End key
2. Press Ctrl + Shift + Back key

Yes, thanks, :wink: I knew I had read it on the forum.
But:
- Two sequences, and three fingers.
- Requires looking at the keyboard
- Not fast
- Not easy on a laptop
- Even slower than clicking on the line number and press 'del'

Delete entire line exist on scintilla and on any Editor and IDE


Top
 Profile  
Reply with quote  
 Post subject: Re: IDE - Delete line under cursor
PostPosted: Thu Feb 11, 2016 5:14 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Dec 23, 2009 10:14 pm
Posts: 3377
Location: Boston, MA
Search for "tool code" and add this...
Code:
  Protected.i np = CountProgramParameters()
  If np
    Protected.i hSci = Val(GetEnvironmentVariable("PB_TOOL_Scintilla"))
    If hSci
      Select UCase(ProgramParameter())  ; 0-based index
      Case "UCASE"      ; Arguments: UCASE, Shortcut = [Ctrl+u]
        SendMessageTimeout_(hSci,#SCI_UPPERCASE,0,0,#SMTO_ABORTIFHUNG,#SCI_TMO_MS,@np)
      Case "LCASE"      ; Arguments: LCASE, Shortcut = [Ctrl+Shift+u], opposite of UCase line = [Ctrl+u]
        SendMessageTimeout_(hSci,#SCI_LOWERCASE,0,0,#SMTO_ABORTIFHUNG,#SCI_TMO_MS,@np)
      Case "LINEDEL"    ; Arguments: LINEDEL, Shortcut = [Ctrl+Shift+d], opposite of duplicate line = [Ctrl+d]
        SendMessageTimeout_(hSci,#SCI_LINEDELETE,0,0,#SMTO_ABORTIFHUNG,#SCI_TMO_MS,@np)
      Case "MVLINESUP"  ; Arguments: MVLINESUP, Shortcut = [Ctrl+Shift+Up]
        SendMessageTimeout_(hSci,#SCI_MOVESELECTEDLINESUP,0,0,#SMTO_ABORTIFHUNG,#SCI_TMO_MS,@np)
      Case "MVLINESDN"  ; Arguments: MVLINESDN, Shortcut = [Ctrl+Shift+Down]
        SendMessageTimeout_(hSci,#SCI_MOVESELECTEDLINESDOWN,0,0,#SMTO_ABORTIFHUNG,#SCI_TMO_MS,@np)
      EndSelect
    EndIf
  EndIf

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


Top
 Profile  
Reply with quote  
 Post subject: IDE - Delete line under cursor
PostPosted: Thu Feb 11, 2016 7:35 pm 
Offline
User
User

Joined: Wed Jun 21, 2006 11:09 am
Posts: 44
Workarounds workarounds...
Why cannot have Scintilla's default key bindings?
Come on Fred do us a favor and implement this. For God's shake, it is a standard shortcut found on almost every editing application! :(


Top
 Profile  
Reply with quote  
 Post subject: Re: IDE - Delete line under cursor
PostPosted: Thu Feb 11, 2016 8:21 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Apr 26, 2003 8:26 am
Posts: 2999
Location: Planet Earth
ssb wrote:
Why cannot have Scintilla's default key bindings?

Works here on Mac, see: http://www.scintilla.org/SciTEDoc.html for default key bindings.
Code:
Line delete.   Ctrl+Shift+L

On Mac OS X it is CMD+SHIFT+L, and it works.


Top
 Profile  
Reply with quote  
 Post subject: Re: IDE - Delete line under cursor
PostPosted: Fri Feb 19, 2016 7:35 pm 
Offline
User
User

Joined: Wed Jun 21, 2006 11:09 am
Posts: 44
On Windows it never worked though


Top
 Profile  
Reply with quote  
 Post subject: Re: IDE - Delete line under cursor
PostPosted: Fri Feb 19, 2016 10:02 pm 
Offline
Addict
Addict
User avatar

Joined: Fri Apr 12, 2013 1:55 pm
Posts: 1058
Location: just outside of Ferguson
skywalk wrote:
Search for "tool code" and add this...
Code:
  Protected.i np {snip}  EndIf

I searched several places and came up empty.

_________________
Keep it BASIC.


Top
 Profile  
Reply with quote  
 Post subject: Re: IDE - Delete line under cursor
PostPosted: Fri Feb 19, 2016 10:44 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Dec 23, 2009 10:14 pm
Posts: 3377
Location: Boston, MA
Try here as a start.
My tool code is very customized for me and all within 1 exe. If the above link is not helpful I can make a generic 1 later.

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


Top
 Profile  
Reply with quote  
 Post subject: Re: IDE - Delete line under cursor
PostPosted: Mon Feb 10, 2020 3:17 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Dec 23, 2003 3:54 am
Posts: 1869
Delete Line shortcut has been merged in Pull Request #54, should be available in PB 5.72 :)
https://github.com/fantaisie-software/purebasic/pull/54

_________________
On GitHub: PB Includes - IDE Tools - Color Themes - IDE Branches - TabBarGadget Mods


Top
 Profile  
Reply with quote  
 Post subject: Re: IDE - Delete line under cursor
PostPosted: Mon Feb 10, 2020 3:35 pm 
Offline
Addict
Addict

Joined: Sat Feb 08, 2014 3:26 pm
Posts: 966
Thanks,

But I "see Delete selected lines"
Does it mean we need to select line(s) before or is it valable for line where cursor is ?
(even with no selection area)

By "Delete line under cursor" I mean like CTRL + D who dupplicate the line where cursor is, even if line is not selected (reverse video)

PS. CTRL + Y is a common shortcut for this and not used in PB IDE: good default shortcut


Top
 Profile  
Reply with quote  
 Post subject: Re: IDE - Delete line under cursor
PostPosted: Mon Feb 10, 2020 3:56 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Dec 23, 2009 10:14 pm
Posts: 3377
Location: Boston, MA
Please NO.
[Ctrl+Y] = standard action for Redo. The opposite of [Ctrl+Z] = Undo.

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


Top
 Profile  
Reply with quote  
 Post subject: Re: IDE - Delete line under cursor
PostPosted: Mon Feb 10, 2020 4:03 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Dec 23, 2003 3:54 am
Posts: 1869
Yes, I think it behaves how you want:
- No selection: the line containing the cursor is deleted
- Selection within one line: the whole line is deleted
- Selection spanning multiple lines: all lines touching the selection are deleted

I tried to follow Scintilla's naming conventions. For example SCI_MOVESELECTEDLINESUP moves the selected lines OR else just the line containing the cursor.


I am looking at the IDE source right now: Ctrl+Y is default mapped to Redo on Windows/Linux.

_________________
On GitHub: PB Includes - IDE Tools - Color Themes - IDE Branches - TabBarGadget Mods


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 13 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