It is currently Fri Nov 24, 2017 3:52 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Improve auto-completion
PostPosted: Wed Sep 13, 2017 10:22 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Jun 25, 2014 5:25 pm
Posts: 167
Location: Germany
For example, the end keyword should be added as soon as you press the enter key in the start keyword line.

Code:
If a = 1{Enter}
should result in:
Code:
If a = 1
  {Cursor position}
EndIf

The same for all the other commands:
While...Wend
Repeat...Until
For...Next
Procedure...EndProcedure
Module...EndModule
and so on

Edit:
My feature request as a animated gif image:
(Wait until the gif image is loaded)
Image
After ";seconds" I press the enter key.

_________________
Image

PureBasic-CodeArchiv-Rebirth: Git-Repository / Download -- Any help is welcome!

Manjaro Cinnamon x64 (Main system) :: WindowsXP/Xubuntu x86 (VirtualBox) :: PureBasic (Linux: x86/x64, Windows: x86) :: All are up to date


Last edited by Sicro on Thu Sep 14, 2017 12:58 am, edited 2 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Improve auto-completion
PostPosted: Wed Sep 13, 2017 2:39 pm 
Offline
Addict
Addict

Joined: Fri Nov 09, 2012 11:04 pm
Posts: 1462
Location: Uttoxeter, UK
Now, that would be nice.

+1

_________________
DE AA EB


Top
 Profile  
Reply with quote  
 Post subject: Re: Improve auto-completion
PostPosted: Wed Sep 13, 2017 3:41 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3142
Location: Berlin, Germany
In the Preferences of the IDE, under "Editor" > "Autocomplete", there is already this option:
Quote:
[ ] Add matching 'End' keyword if insert is pressed twice

According to the explanation in the manual, we should not press [Insert] but [Tab] or [Enter] for this purpose. :-)
Quote:
Add matching ‘End' keyword if Tab/Enter is pressed twice
If you press Tab or Enter twice, it will insert the corresponding end keyword (for example "EndSelect" to "Select" or "EndIf " to "If") to the keyword you have just inserted. The end keyword will be inserted after the cursor, so you can continue typing after the first keyword that was inserted.
However, this feature seems not to work here (PB 5.61 x64 on Windows 10).

BTW: Why twice? Pressing [Enter] once should be enough, no? :-)

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: Improve auto-completion
PostPosted: Wed Sep 13, 2017 4:06 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Oct 09, 2007 2:15 am
Posts: 871
Little John wrote:
However, this feature seems not to work here (PB 5.61 x64 on Windows 10).


I not agree. This feature works. the first TAB to set the word from autocompletepopup and the second TAB to write the "end" keyword.
But the text in the preferences window of the ide says not TAB/Enter it says "insert", so the manual have to be updated to "the inserting key" or similiar...

_________________
PureBasic 5.45 LTS / 5.61 (Windows x86/x64) | Windows10 Pro x64 | Z87-PLUS | i7 4770k | 32GB RAM | iChill GeForce GTX 980 X4 Ultra | HAF XF Evo​​
English is not my native language...


Top
 Profile  
Reply with quote  
 Post subject: Re: Improve auto-completion
PostPosted: Wed Sep 13, 2017 4:18 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3142
Location: Berlin, Germany
Bisonte wrote:
Little John wrote:
However, this feature seems not to work here (PB 5.61 x64 on Windows 10).

I not agree. This feature works. the first TAB to set the word from autocompletepopup and the second TAB to write the "end" keyword.

Thank you for the information!
Well, this is not how I expected it to work. :-(

I don't use autocompletion e.g. when I write If. I type If manuallly, and then press [Enter] once or twice, and EndIf is not inserted automatically. So autocompletion of the "opening" keyword and autocompletion of the "closing" keywored should be handled independent from each other, IMHO.

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: Improve auto-completion
PostPosted: Wed Sep 13, 2017 7:40 pm 
Offline
Addict
Addict

Joined: Fri Nov 09, 2012 11:04 pm
Posts: 1462
Location: Uttoxeter, UK
I use this feature all the time, however, I think that, Sicro was requesting that this feature works even if code is added after the keyword.

My first thought was that this was subtly different. Hmm... not so sure now.

_________________
DE AA EB


Top
 Profile  
Reply with quote  
 Post subject: Re: Improve auto-completion
PostPosted: Wed Sep 13, 2017 11:37 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat May 05, 2007 5:31 pm
Posts: 367
Location: Linz, Austria
Little John wrote:
I don't use autocompletion e.g. when I write If. I type If manuallly, and then press [Enter] once or twice, and EndIf is not inserted automatically
You can 'kinda' do this with my IDE Tool. Type If and press Shift+Return...


Top
 Profile  
Reply with quote  
 Post subject: Re: Improve auto-completion
PostPosted: Thu Sep 14, 2017 5:32 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Jun 25, 2014 5:25 pm
Posts: 167
Location: Germany
@all
I added an animated GIF image to my first post that hopefully will make my request clearer.

@Little John
I know that such a similar function is already integrated in the IDE. But it's ugly when I write "If" and after pressing the TAB key twice, the "EndIf" hangs behind the text cursor as long as I keep writing.

@chi
Nice IDE tool. Unfortunately, it doesn't support Linux and autocomplete only if nothing is written after the "If".

_________________
Image

PureBasic-CodeArchiv-Rebirth: Git-Repository / Download -- Any help is welcome!

Manjaro Cinnamon x64 (Main system) :: WindowsXP/Xubuntu x86 (VirtualBox) :: PureBasic (Linux: x86/x64, Windows: x86) :: All are up to date


Top
 Profile  
Reply with quote  
 Post subject: Re: Improve auto-completion
PostPosted: Thu Sep 14, 2017 6:32 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3142
Location: Berlin, Germany
@Sicro:
I absolutely agree with you. I didn't make that clear previously, sorry!
What you are demonstrating above is exactly the way how I am writing code.
I would appreciate this suggested feature very much!
+1

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


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

All times are UTC + 1 hour


Who is online

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