IDE - Delete line under cursor
IDE - Delete line under cursor
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
Do not set any shortcut: Let the user set the shortcut he wants to please everybody
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
Do not set any shortcut: Let the user set the shortcut he wants to please everybody
Re: IDE - Delete line under cursor
Yes, thanks, I knew I had read it on the forum.RSBasic wrote:Alternative:
1. Press End key
2. Press Ctrl + Shift + Back key
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
Re: IDE - Delete line under cursor
Search for "tool code" and add this...
Code: Select all
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
IDE - Delete line under cursor
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!
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!
Re: IDE - Delete line under cursor
Works here on Mac, see: http://www.scintilla.org/SciTEDoc.html for default key bindings.ssb wrote:Why cannot have Scintilla's default key bindings?
Code: Select all
Line delete. Ctrl+Shift+L
Re: IDE - Delete line under cursor
On Windows it never worked though
Re: IDE - Delete line under cursor
I searched several places and came up empty.skywalk wrote:Search for "tool code" and add this...Code: Select all
Protected.i np {snip} EndIf
Keep it BASIC.
Re: IDE - Delete line under cursor
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.
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
Re: IDE - Delete line under cursor
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
https://github.com/fantaisie-software/purebasic/pull/54
Re: IDE - Delete line under cursor
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
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
Re: IDE - Delete line under cursor
Please NO.
[Ctrl+Y] = standard action for Redo. The opposite of [Ctrl+Z] = Undo.
[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
Re: IDE - Delete line under cursor
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.
- 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.