discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Re: [OpenSCAD] Abbreviations

A
alex@alexgibson.net
Wed, Jun 8, 2016 9:57 AM

Hi Maurizio,

This sounds great!!!
For stupid/busy people - how do I install your patch to try it in Linux
and/or Windows please?

Cheers
Alex

-------- Original Message --------
Subject: [OpenSCAD] Abbreviations
From: maurizio butti maurizio.butti@gmail.com
Date: Wed, June 08, 2016 9:18 am
To: discuss@lists.openscad.org

I often use the Scite editor, based on the same Scintilla component as
OpenSCAD. As such I am really missing a very good Scite feature:
abbreviations. I implemented (in a rather crude way) abbreviation expansion
for common OpenSCAD constructs. This should allow for really fast coding.
As a bonus I added folding toggle as a keyboard shortcut (CTRL+*, also
added to the edit menu as "Toggle current fold").

*How this works:
Type a single character abbreviation in the editor, for example "c". Then
hit CTRL+B. The typed character has been replaced by "cube([]);". The
cursor is now positioned after the open square bracket for you to enter the
cube's dimensions.

*Full list of abreviations (the | character is not included but shows where
the caret will be positioned):
c cube([|]);
d difference() {\n\t|\n}
f for (i=[|]) {\n\t\n}
i intersection() {\n\t|\n}
m module |() {\n\t\n}
r rotate([|]);
s sphere(r=|);
t translate([|])
u union() {\n\t|\n}
x ,center=true|
y cylinder(r=|,h=);<hr>_______________________________________________
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Hi Maurizio, This sounds great!!! For stupid/busy people - how do I install your patch to try it in Linux and/or Windows please? Cheers Alex > -------- Original Message -------- > Subject: [OpenSCAD] Abbreviations > From: maurizio butti <maurizio.butti@gmail.com> > Date: Wed, June 08, 2016 9:18 am > To: discuss@lists.openscad.org > > > I often use the Scite editor, based on the same Scintilla component as > OpenSCAD. As such I am really missing a very good Scite feature: > abbreviations. I implemented (in a rather crude way) abbreviation expansion > for common OpenSCAD constructs. This should allow for really fast coding. > As a bonus I added folding toggle as a keyboard shortcut (CTRL+*, also > added to the edit menu as "Toggle current fold"). > > *How this works: > Type a single character abbreviation in the editor, for example "c". Then > hit CTRL+B. The typed character has been replaced by "cube([]);". The > cursor is now positioned after the open square bracket for you to enter the > cube's dimensions. > > *Full list of abreviations (the | character is not included but shows where > the caret will be positioned): > c cube([|]); > d difference() {\n\t|\n} > f for (i=[|]) {\n\t\n} > i intersection() {\n\t|\n} > m module |() {\n\t\n} > r rotate([|]); > s sphere(r=|); > t translate([|]) > u union() {\n\t|\n} > x ,center=true| > y cylinder(r=|,h=);<hr>_______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
B
buttim
Wed, Jun 8, 2016 12:32 PM

I'm not the best one to reply to this question but I'll do my best.
Basically you should download the source, apply the patch i submitted (via
the patch command) and the compile everything.
The steps for compiling can be found in OpenSCAD README.md file.

Although building for Linux is feasible it is still quite a lengthy process.
The Windows build is quite a nightmare though.

Though, since this little mod seems to have spread some interest you'd
better wait for it to be integrated and the binary be available in the
development snapshots.

alexgibson wrote

This sounds great!!!
For stupid/busy people - how do I install your patch to try it in Linux
and/or Windows please?

--
View this message in context: http://forum.openscad.org/Abbreviations-tp17583p17588.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I'm not the best one to reply to this question but I'll do my best. Basically you should download the source, apply the patch i submitted (via the patch command) and the compile everything. The steps for compiling can be found in OpenSCAD README.md file. Although building for Linux is feasible it is still quite a lengthy process. The Windows build is quite a nightmare though. Though, since this little mod seems to have spread some interest you'd better wait for it to be integrated and the binary be available in the development snapshots. alexgibson wrote > This sounds great!!! > For stupid/busy people - how do I install your patch to try it in Linux > and/or Windows please? -- View this message in context: http://forum.openscad.org/Abbreviations-tp17583p17588.html Sent from the OpenSCAD mailing list archive at Nabble.com.
TP
Torsten Paul
Wed, Jun 8, 2016 12:47 PM

Though, since this little mod seems to have spread some interest you'd
better wait for it to be integrated and the binary be available in the
development snapshots.

The Linux nightly builds are always based on the master branch, so
it would pick it up only when officially included.

I can try to kick off a special Windows build though.

ciao,
Torsten.

> Though, since this little mod seems to have spread some interest you'd > better wait for it to be integrated and the binary be available in the > development snapshots. > The Linux nightly builds are always based on the master branch, so it would pick it up only when officially included. I can try to kick off a special Windows build though. ciao, Torsten.
TP
Torsten Paul
Wed, Jun 8, 2016 7:13 PM
On 06/08/2016 02:47 PM, Torsten Paul wrote: > I can try to kick off a special Windows build though. > http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-32_abbrev-patch-Installer.exe http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-32_abbrev-patch.zip http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-64_abbrev-patch-Installer.exe http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-64_abbrev-patch.zip ciao, Torsten.
B
buttim
Wed, Jun 8, 2016 7:17 PM

Wooooooooo Hoooooooooooooo!

Thanks!!
Il 08/giu/2016 21:13, "tp3 [via OpenSCAD]" <
ml-node+s1091067n17602h37@n5.nabble.com> ha scritto:

--
View this message in context: http://forum.openscad.org/Abbreviations-tp17583p17603.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Wooooooooo Hoooooooooooooo! Thanks!! Il 08/giu/2016 21:13, "tp3 [via OpenSCAD]" < ml-node+s1091067n17602h37@n5.nabble.com> ha scritto: > On 06/08/2016 02:47 PM, Torsten Paul wrote: > > I can try to kick off a special Windows build though. > > > > http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-32_abbrev-patch-Installer.exe > > http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-32_abbrev-patch.zip > > http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-64_abbrev-patch-Installer.exe > > http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-64_abbrev-patch.zip > > ciao, > Torsten. > > _______________________________________________ > OpenSCAD mailing list > [hidden email] <http:///user/SendEmail.jtp?type=node&node=17602&i=0> > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > -- Torsten > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > http://forum.openscad.org/Abbreviations-tp17583p17602.html > To unsubscribe from Abbreviations, click here > <http://forum.openscad.org/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=17583&code=bWF1cml6aW8uYnV0dGlAZ21haWwuY29tfDE3NTgzfDE4OTg0NTUyNTk=> > . > NAML > <http://forum.openscad.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- View this message in context: http://forum.openscad.org/Abbreviations-tp17583p17603.html Sent from the OpenSCAD mailing list archive at Nabble.com.
TP
Torsten Paul
Wed, Jun 8, 2016 9:26 PM

On 06/08/2016 02:47 PM, Torsten Paul wrote:

I can try to kick off a special Windows build though.

On 06/08/2016 02:47 PM, Torsten Paul wrote: > I can try to kick off a special Windows build though. > ...aaaaaand for completeness, that's the version with the AutoComplete/CallTip and Template implementation based on the QScintilla features. http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-32_issue905-Installer.exe http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-32_issue905.zip http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-64_issue905-Installer.exe http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-64_issue905.zip The template popup should be triggered by CTRL+Enter ciao, Torsten.
B
buttim
Thu, Jun 9, 2016 6:42 AM

Interesting approach. But I think you should check what's on the left of
the cursor to restrict choices. For example: if there's a 'c' the choices
should only be 'cube' and 'cylinder'; if you find 'cy' you just complete to
'cylinder' with no menu appearing. Most IDEs I've seen work that way.
Scintilla has a very nice 'wordlist completion' based on whatever is in the
document you're editing. That means you can easily complete long
identifiers hitting CTRL+ENTER. I'm thinking about trying to add this
functionality, it might be straightforward but I'm not sure.

On Wed, Jun 8, 2016 at 11:27 PM, tp3 [via OpenSCAD] <
ml-node+s1091067n17607h92@n5.nabble.com> wrote:

On 06/08/2016 02:47 PM, Torsten Paul wrote:

I can try to kick off a special Windows build though.

...aaaaaand for completeness, that's the version with the
AutoComplete/CallTip and Template implementation based on
the QScintilla features.

http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-32_issue905-Installer.exe
http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-32_issue905.zip

http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-64_issue905-Installer.exe
http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-64_issue905.zip

The template popup should be triggered by CTRL+Enter

ciao,
Torsten.


OpenSCAD mailing list
[hidden email] http:///user/SendEmail.jtp?type=node&node=17607&i=0
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
-- Torsten


If you reply to this email, your message will be added to the discussion
below:
http://forum.openscad.org/Abbreviations-tp17583p17607.html
To unsubscribe from Abbreviations, click here
http://forum.openscad.org/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=17583&code=bWF1cml6aW8uYnV0dGlAZ21haWwuY29tfDE3NTgzfDE4OTg0NTUyNTk=
.
NAML
http://forum.openscad.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml

--
View this message in context: http://forum.openscad.org/Abbreviations-tp17583p17610.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Interesting approach. But I think you should check what's on the left of the cursor to restrict choices. For example: if there's a 'c' the choices should only be 'cube' and 'cylinder'; if you find 'cy' you just complete to 'cylinder' with no menu appearing. Most IDEs I've seen work that way. Scintilla has a very nice 'wordlist completion' based on whatever is in the document you're editing. That means you can easily complete long identifiers hitting CTRL+ENTER. I'm thinking about trying to add this functionality, it might be straightforward but I'm not sure. On Wed, Jun 8, 2016 at 11:27 PM, tp3 [via OpenSCAD] < ml-node+s1091067n17607h92@n5.nabble.com> wrote: > On 06/08/2016 02:47 PM, Torsten Paul wrote: > > I can try to kick off a special Windows build though. > > > ...aaaaaand for completeness, that's the version with the > AutoComplete/CallTip and Template implementation based on > the QScintilla features. > > > http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-32_issue905-Installer.exe > http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-32_issue905.zip > > http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-64_issue905-Installer.exe > http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-64_issue905.zip > > The template popup should be triggered by CTRL+Enter > > ciao, > Torsten. > > > _______________________________________________ > OpenSCAD mailing list > [hidden email] <http:///user/SendEmail.jtp?type=node&node=17607&i=0> > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > -- Torsten > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > http://forum.openscad.org/Abbreviations-tp17583p17607.html > To unsubscribe from Abbreviations, click here > <http://forum.openscad.org/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=17583&code=bWF1cml6aW8uYnV0dGlAZ21haWwuY29tfDE3NTgzfDE4OTg0NTUyNTk=> > . > NAML > <http://forum.openscad.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- View this message in context: http://forum.openscad.org/Abbreviations-tp17583p17610.html Sent from the OpenSCAD mailing list archive at Nabble.com.
M
MichaelAtOz
Thu, Jun 9, 2016 9:01 AM

http://www.thingiverse.com/thing:15363
http://www.thingiverse.com/thing:26537
http://www.thingiverse.com/thing:26853
http://www.thingiverse.com/thing:29505
http://www.thingiverse.com/thing:167899
http://www.thingiverse.com/thing:280319
http://www.thingiverse.com/thing:681028

May relate.

+1 to tp's config file, there are many personal preferences to how to do
this. Personally I like np++'s style.


Admin - PM me if you need anything, or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/  time is running out!

View this message in context: http://forum.openscad.org/Abbreviations-tp17583p17612.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

http://www.thingiverse.com/thing:15363 http://www.thingiverse.com/thing:26537 http://www.thingiverse.com/thing:26853 http://www.thingiverse.com/thing:29505 http://www.thingiverse.com/thing:167899 http://www.thingiverse.com/thing:280319 http://www.thingiverse.com/thing:681028 May relate. +1 to tp's config file, there are many personal preferences to how to do this. Personally I like np++'s style. ----- Admin - PM me if you need anything, or if I've done something stupid... Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out! -- View this message in context: http://forum.openscad.org/Abbreviations-tp17583p17612.html Sent from the OpenSCAD mailing list archive at Nabble.com.
B
buttim
Thu, Jun 9, 2016 11:39 AM

If you specify

qsci->setAutoCompletionShowSingle(true);

the dropdown menu is not shown when there is a single choice available

On Thu, Jun 9, 2016 at 8:42 AM, maurizio butti maurizio.butti@gmail.com
wrote:

Interesting approach. But I think you should check what's on the left of
the cursor to restrict choices. For example: if there's a 'c' the choices
should only be 'cube' and 'cylinder'; if you find 'cy' you just complete to
'cylinder' with no menu appearing. Most IDEs I've seen work that way.
Scintilla has a very nice 'wordlist completion' based on whatever is in
the document you're editing. That means you can easily complete long
identifiers hitting CTRL+ENTER. I'm thinking about trying to add this
functionality, it might be straightforward but I'm not sure.

On Wed, Jun 8, 2016 at 11:27 PM, tp3 [via OpenSCAD] <
ml-node+s1091067n17607h92@n5.nabble.com> wrote:

On 06/08/2016 02:47 PM, Torsten Paul wrote:

I can try to kick off a special Windows build though.

...aaaaaand for completeness, that's the version with the
AutoComplete/CallTip and Template implementation based on
the QScintilla features.

http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-32_issue905-Installer.exe

http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-32_issue905.zip

http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-64_issue905-Installer.exe

http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-64_issue905.zip

The template popup should be triggered by CTRL+Enter

ciao,
Torsten.


OpenSCAD mailing list
[hidden email] http:///user/SendEmail.jtp?type=node&node=17607&i=0
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
-- Torsten


If you reply to this email, your message will be added to the discussion
below:
http://forum.openscad.org/Abbreviations-tp17583p17607.html
To unsubscribe from Abbreviations, click here
http://forum.openscad.org/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=17583&code=bWF1cml6aW8uYnV0dGlAZ21haWwuY29tfDE3NTgzfDE4OTg0NTUyNTk=
.
NAML
http://forum.openscad.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml

--
View this message in context: http://forum.openscad.org/Abbreviations-tp17583p17614.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

If you specify qsci->setAutoCompletionShowSingle(true); the dropdown menu is not shown when there is a single choice available On Thu, Jun 9, 2016 at 8:42 AM, maurizio butti <maurizio.butti@gmail.com> wrote: > Interesting approach. But I think you should check what's on the left of > the cursor to restrict choices. For example: if there's a 'c' the choices > should only be 'cube' and 'cylinder'; if you find 'cy' you just complete to > 'cylinder' with no menu appearing. Most IDEs I've seen work that way. > Scintilla has a very nice 'wordlist completion' based on whatever is in > the document you're editing. That means you can easily complete long > identifiers hitting CTRL+ENTER. I'm thinking about trying to add this > functionality, it might be straightforward but I'm not sure. > > On Wed, Jun 8, 2016 at 11:27 PM, tp3 [via OpenSCAD] < > ml-node+s1091067n17607h92@n5.nabble.com> wrote: > >> On 06/08/2016 02:47 PM, Torsten Paul wrote: >> > I can try to kick off a special Windows build though. >> > >> ...aaaaaand for completeness, that's the version with the >> AutoComplete/CallTip and Template implementation based on >> the QScintilla features. >> >> >> http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-32_issue905-Installer.exe >> >> http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-32_issue905.zip >> >> http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-64_issue905-Installer.exe >> >> http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-64_issue905.zip >> >> The template popup should be triggered by CTRL+Enter >> >> ciao, >> Torsten. >> >> >> _______________________________________________ >> OpenSCAD mailing list >> [hidden email] <http:///user/SendEmail.jtp?type=node&node=17607&i=0> >> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >> -- Torsten >> >> >> ------------------------------ >> If you reply to this email, your message will be added to the discussion >> below: >> http://forum.openscad.org/Abbreviations-tp17583p17607.html >> To unsubscribe from Abbreviations, click here >> <http://forum.openscad.org/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=17583&code=bWF1cml6aW8uYnV0dGlAZ21haWwuY29tfDE3NTgzfDE4OTg0NTUyNTk=> >> . >> NAML >> <http://forum.openscad.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> >> > > -- View this message in context: http://forum.openscad.org/Abbreviations-tp17583p17614.html Sent from the OpenSCAD mailing list archive at Nabble.com.
B
buttim
Thu, Jun 9, 2016 2:30 PM

I added the "document autocomplete" feature. Basically CTRL+Return triggers
an autocompletion based on the list of words in the document you're editing.

Beware that Return means the key on the alphabetic portion of your
keyboard, not in the numeric keypad.

I'm thinking about moving the abbreviation list to an external file. Can
someone point me in the right direction for choosing a format and location
for the file? I was thinking about a per-user JSON file.
The format might be something like this:
{
"t" : {
"l" : "translate([",
"r" : "])"
}
}

where l and r stand for left and right of cursor

Is it too complicated? Should I stick to the very same format
https://sourceforge.net/p/scintilla/scite/ci/default/tree/src/abbrev.properties
SciTE uses ?

On Thu, Jun 9, 2016 at 1:39 PM, maurizio butti maurizio.butti@gmail.com
wrote:

If you specify

qsci->setAutoCompletionShowSingle(true);

the dropdown menu is not shown when there is a single choice available

On Thu, Jun 9, 2016 at 8:42 AM, maurizio butti maurizio.butti@gmail.com
wrote:

Interesting approach. But I think you should check what's on the left of
the cursor to restrict choices. For example: if there's a 'c' the choices
should only be 'cube' and 'cylinder'; if you find 'cy' you just complete to
'cylinder' with no menu appearing. Most IDEs I've seen work that way.
Scintilla has a very nice 'wordlist completion' based on whatever is in
the document you're editing. That means you can easily complete long
identifiers hitting CTRL+ENTER. I'm thinking about trying to add this
functionality, it might be straightforward but I'm not sure.

On Wed, Jun 8, 2016 at 11:27 PM, tp3 [via OpenSCAD] <
ml-node+s1091067n17607h92@n5.nabble.com> wrote:

On 06/08/2016 02:47 PM, Torsten Paul wrote:

I can try to kick off a special Windows build though.

...aaaaaand for completeness, that's the version with the
AutoComplete/CallTip and Template implementation based on
the QScintilla features.

http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-32_issue905-Installer.exe

http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-32_issue905.zip

http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-64_issue905-Installer.exe

http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-64_issue905.zip

The template popup should be triggered by CTRL+Enter

ciao,
Torsten.


OpenSCAD mailing list
[hidden email] http:///user/SendEmail.jtp?type=node&node=17607&i=0
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
-- Torsten


If you reply to this email, your message will be added to the discussion
below:
http://forum.openscad.org/Abbreviations-tp17583p17607.html
To unsubscribe from Abbreviations, click here
http://forum.openscad.org/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=17583&code=bWF1cml6aW8uYnV0dGlAZ21haWwuY29tfDE3NTgzfDE4OTg0NTUyNTk=
.
NAML
http://forum.openscad.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml

editor-improvement2.patch (4K) http://forum.openscad.org/attachment/17616/0/editor-improvement2.patch

--
View this message in context: http://forum.openscad.org/Abbreviations-tp17583p17616.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I added the "document autocomplete" feature. Basically CTRL+Return triggers an autocompletion based on the list of words in the document you're editing. Beware that Return means the key on the alphabetic portion of your keyboard, not in the numeric keypad. I'm thinking about moving the abbreviation list to an external file. Can someone point me in the right direction for choosing a format and location for the file? I was thinking about a per-user JSON file. The format might be something like this: { "t" : { "l" : "translate([", "r" : "])" } } where l and r stand for left and right of cursor Is it too complicated? Should I stick to the very same format <https://sourceforge.net/p/scintilla/scite/ci/default/tree/src/abbrev.properties> SciTE uses ? On Thu, Jun 9, 2016 at 1:39 PM, maurizio butti <maurizio.butti@gmail.com> wrote: > If you specify > > qsci->setAutoCompletionShowSingle(true); > > the dropdown menu is not shown when there is a single choice available > > On Thu, Jun 9, 2016 at 8:42 AM, maurizio butti <maurizio.butti@gmail.com> > wrote: > >> Interesting approach. But I think you should check what's on the left of >> the cursor to restrict choices. For example: if there's a 'c' the choices >> should only be 'cube' and 'cylinder'; if you find 'cy' you just complete to >> 'cylinder' with no menu appearing. Most IDEs I've seen work that way. >> Scintilla has a very nice 'wordlist completion' based on whatever is in >> the document you're editing. That means you can easily complete long >> identifiers hitting CTRL+ENTER. I'm thinking about trying to add this >> functionality, it might be straightforward but I'm not sure. >> >> On Wed, Jun 8, 2016 at 11:27 PM, tp3 [via OpenSCAD] < >> ml-node+s1091067n17607h92@n5.nabble.com> wrote: >> >>> On 06/08/2016 02:47 PM, Torsten Paul wrote: >>> > I can try to kick off a special Windows build though. >>> > >>> ...aaaaaand for completeness, that's the version with the >>> AutoComplete/CallTip and Template implementation based on >>> the QScintilla features. >>> >>> >>> http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-32_issue905-Installer.exe >>> >>> http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-32_issue905.zip >>> >>> http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-64_issue905-Installer.exe >>> >>> http://files.openscad.org/snapshots/OpenSCAD-2016.06.08-x86-64_issue905.zip >>> >>> The template popup should be triggered by CTRL+Enter >>> >>> ciao, >>> Torsten. >>> >>> >>> _______________________________________________ >>> OpenSCAD mailing list >>> [hidden email] <http:///user/SendEmail.jtp?type=node&node=17607&i=0> >>> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >>> -- Torsten >>> >>> >>> ------------------------------ >>> If you reply to this email, your message will be added to the discussion >>> below: >>> http://forum.openscad.org/Abbreviations-tp17583p17607.html >>> To unsubscribe from Abbreviations, click here >>> <http://forum.openscad.org/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=17583&code=bWF1cml6aW8uYnV0dGlAZ21haWwuY29tfDE3NTgzfDE4OTg0NTUyNTk=> >>> . >>> NAML >>> <http://forum.openscad.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> >>> >> >> > editor-improvement2.patch (4K) <http://forum.openscad.org/attachment/17616/0/editor-improvement2.patch> -- View this message in context: http://forum.openscad.org/Abbreviations-tp17583p17616.html Sent from the OpenSCAD mailing list archive at Nabble.com.