Re: [Geany-devel] (no subject)
On Thu, 1 Dec 2011 14:57:25 -0500 Meyer <3m.me...@gmail.com> wrote: > I have two possible situations that I need to differentiate between > [...] The first situation is the user deletes selected text by > overwriting it with a new character. The second is the user deletes > selected text by pressing backspace/delete, and then enters a new > character. [...] how I could accomplish this? You can't. The underlying scintilla events are identical. > I want to be able to select text, and then insert a character (e.g. > an apostrophe) before and after the selection just by pressing the > apostrophe key. Since the normal behavior when a character is > pressed while text is selected is to delete the text and insert a > character [...] Ignore keybindings and see extrasel key-press-event. Remember to check scintilla_get_current() against the widget. Somebody ( Nathan Broadbent?) recently asked the exactly same question, and probably works on the same thing. Check the mailing list archive. -- E-gards: Jimmy ___ Geany-devel mailing list Geany-devel@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
Re: [Geany-devel] (no subject)
Am 02.12.2011 01:20, schrieb Lex Trotman: > On Fri, Dec 2, 2011 at 10:54 AM, Meyer <3m.me...@gmail.com> wrote: >> Sure. I want to be able to select text, and then insert a character (e.g. >> an apostrophe) before and after the selection just by pressing the >> apostrophe key. Since the normal behavior when a character is pressed while >> text is selected is to delete the text and insert a character, I need to >> know when that happens - then I could undo the delete and insert my >> characters. If it was two separate events though - delete then insert - I >> won't want to do anything. >> >> I have it working now, but it seems awfully hackish: when one of the >> characters I might insert is pressed, I store the current position of the >> cursor and undo the last event. If the new cursor position is the same >> place as the old one, then it was a "overwrite" event. Otherwise, it was >> delete then insert. >> >> So, any ideas for how I could do this would be much appreciated! > > I assume you are writing a plugin. > > You should use the keybinding system to capture the apostrophe before > it goes to scintilla so you can detect and do anything you want. You could also use editor_nodify signal [1]. E.g. used in GeanyLaTeX plugin for doing something similar. Cheers, Frank [1] http://www.geany.org/manual/reference/pluginsignals_8c.html#af601d8beb39bf8082ddd1c09c74ce892 ___ Geany-devel mailing list Geany-devel@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
Re: [Geany-devel] (no subject)
Hi, I've started integrating my plugin into the Addons plugin. As of now, it adds two check boxes to the Addons preferences to enable wrapping text automatically (just by hitting apostrophe) and wrapping text by hitting a key combo. The first method seems to work, the second should work but you can't define the wrap combos yet. I've just put that on my github repo, and should have time tomorrow to finish it up. Cheers, Alex On Thu, Dec 1, 2011 at 10:44 PM, Nathan Broadbent wrote: > Hi Alex, > > I'm also really keen for this feature, so could I please request a recent > copy of the plugin? Perhaps you could update your repo on github? > I'd like to start using it right away, and could help to fix any bugs. > > I also really think that this should to be added to the 'Auto-close quotes > and brackets' feature in core Geany, since it is the expected behavior for > any user coming from TextMate or Gedit. > > > Regards, > Nathan > > > > On Thu, Dec 1, 2011 at 7:20 PM, Lex Trotman wrote: >> >>> On Fri, Dec 2, 2011 at 10:54 AM, Meyer <3m.me...@gmail.com> wrote: >>> > Sure. I want to be able to select text, and then insert a character >>> (e.g. >>> > an apostrophe) before and after the selection just by pressing the >>> > apostrophe key. Since the normal behavior when a character is pressed >>> while >>> > text is selected is to delete the text and insert a character, I need >>> to >>> > know when that happens - then I could undo the delete and insert my >>> > characters. If it was two separate events though - delete then insert >>> - I >>> > won't want to do anything. >>> > >>> > I have it working now, but it seems awfully hackish: when one of the >>> > characters I might insert is pressed, I store the current position of >>> the >>> > cursor and undo the last event. If the new cursor position is the same >>> > place as the old one, then it was a "overwrite" event. Otherwise, it >>> was >>> > delete then insert. >>> > >>> > So, any ideas for how I could do this would be much appreciated! >>> >>> I assume you are writing a plugin. >>> >>> You should use the keybinding system to capture the apostrophe before >>> it goes to scintilla so you can detect and do anything you want. >>> >>> Cheers >>> Lex >>> >>> > >>> > Alex >>> > >>> > On Thu, Dec 1, 2011 at 3:40 PM, Frank Lanitz >>> wrote: >>> >> >>> >> Am 01.12.2011 20:57, schrieb Meyer: >>> >> > I have two possible situations that I need to differentiate >>> between, and >>> >> > I'm not sure how to do it - The first situation is the user deletes >>> >> > selected text by overwriting it with a new character. The second >>> is the >>> >> > user deletes selected text by pressing backspace/delete, and then >>> enters >>> >> > a new character. I thought this would be fairly easy, but I've been >>> >> > trying to figure it out for awhile and haven't gotten anywhere. Does >>> >> > anyone have any ideas for how I could accomplish this? >>> >> >>> >> Can you go into more details in which context you need that >>> information? >>> >> >>> >> Cheers, >>> >> Frank >>> >> >>> >> >>> >> >>> >> ___ >>> >> Geany-devel mailing list >>> >> Geany-devel@uvena.de >>> >> https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel >>> >> >>> > >>> > >>> > ___ >>> > Geany-devel mailing list >>> > Geany-devel@uvena.de >>> > https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel >>> > >>> ___ >>> Geany-devel mailing list >>> Geany-devel@uvena.de >>> https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel >>> >> >> >> ___ >> Geany-devel mailing list >> Geany-devel@uvena.de >> https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel >> >> > > ___ > Geany-devel mailing list > Geany-devel@uvena.de > https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel > > ___ Geany-devel mailing list Geany-devel@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
Re: [Geany-devel] (no subject)
Hi Alex, I'm also really keen for this feature, so could I please request a recent copy of the plugin? Perhaps you could update your repo on github? I'd like to start using it right away, and could help to fix any bugs. I also really think that this should to be added to the 'Auto-close quotes and brackets' feature in core Geany, since it is the expected behavior for any user coming from TextMate or Gedit. Regards, Nathan On Thu, Dec 1, 2011 at 7:20 PM, Lex Trotman wrote: > >> On Fri, Dec 2, 2011 at 10:54 AM, Meyer <3m.me...@gmail.com> wrote: >> > Sure. I want to be able to select text, and then insert a character >> (e.g. >> > an apostrophe) before and after the selection just by pressing the >> > apostrophe key. Since the normal behavior when a character is pressed >> while >> > text is selected is to delete the text and insert a character, I need to >> > know when that happens - then I could undo the delete and insert my >> > characters. If it was two separate events though - delete then insert >> - I >> > won't want to do anything. >> > >> > I have it working now, but it seems awfully hackish: when one of the >> > characters I might insert is pressed, I store the current position of >> the >> > cursor and undo the last event. If the new cursor position is the same >> > place as the old one, then it was a "overwrite" event. Otherwise, it >> was >> > delete then insert. >> > >> > So, any ideas for how I could do this would be much appreciated! >> >> I assume you are writing a plugin. >> >> You should use the keybinding system to capture the apostrophe before >> it goes to scintilla so you can detect and do anything you want. >> >> Cheers >> Lex >> >> > >> > Alex >> > >> > On Thu, Dec 1, 2011 at 3:40 PM, Frank Lanitz >> wrote: >> >> >> >> Am 01.12.2011 20:57, schrieb Meyer: >> >> > I have two possible situations that I need to differentiate between, >> and >> >> > I'm not sure how to do it - The first situation is the user deletes >> >> > selected text by overwriting it with a new character. The second is >> the >> >> > user deletes selected text by pressing backspace/delete, and then >> enters >> >> > a new character. I thought this would be fairly easy, but I've been >> >> > trying to figure it out for awhile and haven't gotten anywhere. Does >> >> > anyone have any ideas for how I could accomplish this? >> >> >> >> Can you go into more details in which context you need that >> information? >> >> >> >> Cheers, >> >> Frank >> >> >> >> >> >> >> >> ___ >> >> Geany-devel mailing list >> >> Geany-devel@uvena.de >> >> https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel >> >> >> > >> > >> > ___ >> > Geany-devel mailing list >> > Geany-devel@uvena.de >> > https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel >> > >> ___ >> Geany-devel mailing list >> Geany-devel@uvena.de >> https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel >> > > > ___ > Geany-devel mailing list > Geany-devel@uvena.de > https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel > > ___ Geany-devel mailing list Geany-devel@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
Re: [Geany-devel] (no subject)
D'oh. I had tried that first, but incorrectly I guess and came to the conclusion that you couldn't use keybindings with just a single character. I suppose I shouldn't have given up so quickly, it's working perfectly now. Thanks! Alex On Thu, Dec 1, 2011 at 7:20 PM, Lex Trotman wrote: > On Fri, Dec 2, 2011 at 10:54 AM, Meyer <3m.me...@gmail.com> wrote: > > Sure. I want to be able to select text, and then insert a character > (e.g. > > an apostrophe) before and after the selection just by pressing the > > apostrophe key. Since the normal behavior when a character is pressed > while > > text is selected is to delete the text and insert a character, I need to > > know when that happens - then I could undo the delete and insert my > > characters. If it was two separate events though - delete then insert - > I > > won't want to do anything. > > > > I have it working now, but it seems awfully hackish: when one of the > > characters I might insert is pressed, I store the current position of the > > cursor and undo the last event. If the new cursor position is the same > > place as the old one, then it was a "overwrite" event. Otherwise, it was > > delete then insert. > > > > So, any ideas for how I could do this would be much appreciated! > > I assume you are writing a plugin. > > You should use the keybinding system to capture the apostrophe before > it goes to scintilla so you can detect and do anything you want. > > Cheers > Lex > > > > > Alex > > > > On Thu, Dec 1, 2011 at 3:40 PM, Frank Lanitz > wrote: > >> > >> Am 01.12.2011 20:57, schrieb Meyer: > >> > I have two possible situations that I need to differentiate between, > and > >> > I'm not sure how to do it - The first situation is the user deletes > >> > selected text by overwriting it with a new character. The second is > the > >> > user deletes selected text by pressing backspace/delete, and then > enters > >> > a new character. I thought this would be fairly easy, but I've been > >> > trying to figure it out for awhile and haven't gotten anywhere. Does > >> > anyone have any ideas for how I could accomplish this? > >> > >> Can you go into more details in which context you need that information? > >> > >> Cheers, > >> Frank > >> > >> > >> > >> ___ > >> Geany-devel mailing list > >> Geany-devel@uvena.de > >> https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel > >> > > > > > > ___ > > Geany-devel mailing list > > Geany-devel@uvena.de > > https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel > > > ___ > Geany-devel mailing list > Geany-devel@uvena.de > https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel > ___ Geany-devel mailing list Geany-devel@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
Re: [Geany-devel] (no subject)
On Fri, Dec 2, 2011 at 10:54 AM, Meyer <3m.me...@gmail.com> wrote: > Sure. I want to be able to select text, and then insert a character (e.g. > an apostrophe) before and after the selection just by pressing the > apostrophe key. Since the normal behavior when a character is pressed while > text is selected is to delete the text and insert a character, I need to > know when that happens - then I could undo the delete and insert my > characters. If it was two separate events though - delete then insert - I > won't want to do anything. > > I have it working now, but it seems awfully hackish: when one of the > characters I might insert is pressed, I store the current position of the > cursor and undo the last event. If the new cursor position is the same > place as the old one, then it was a "overwrite" event. Otherwise, it was > delete then insert. > > So, any ideas for how I could do this would be much appreciated! I assume you are writing a plugin. You should use the keybinding system to capture the apostrophe before it goes to scintilla so you can detect and do anything you want. Cheers Lex > > Alex > > On Thu, Dec 1, 2011 at 3:40 PM, Frank Lanitz wrote: >> >> Am 01.12.2011 20:57, schrieb Meyer: >> > I have two possible situations that I need to differentiate between, and >> > I'm not sure how to do it - The first situation is the user deletes >> > selected text by overwriting it with a new character. The second is the >> > user deletes selected text by pressing backspace/delete, and then enters >> > a new character. I thought this would be fairly easy, but I've been >> > trying to figure it out for awhile and haven't gotten anywhere. Does >> > anyone have any ideas for how I could accomplish this? >> >> Can you go into more details in which context you need that information? >> >> Cheers, >> Frank >> >> >> >> ___ >> Geany-devel mailing list >> Geany-devel@uvena.de >> https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel >> > > > ___ > Geany-devel mailing list > Geany-devel@uvena.de > https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel > ___ Geany-devel mailing list Geany-devel@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
Re: [Geany-devel] (no subject)
Sure. I want to be able to select text, and then insert a character (e.g. an apostrophe) before and after the selection just by pressing the apostrophe key. Since the normal behavior when a character is pressed while text is selected is to delete the text and insert a character, I need to know when that happens - then I could undo the delete and insert my characters. If it was two separate events though - delete then insert - I won't want to do anything. I have it working now, but it seems awfully hackish: when one of the characters I might insert is pressed, I store the current position of the cursor and undo the last event. If the new cursor position is the same place as the old one, then it was a "overwrite" event. Otherwise, it was delete then insert. So, any ideas for how I could do this would be much appreciated! Alex On Thu, Dec 1, 2011 at 3:40 PM, Frank Lanitz wrote: > Am 01.12.2011 20:57, schrieb Meyer: > > I have two possible situations that I need to differentiate between, and > > I'm not sure how to do it - The first situation is the user deletes > > selected text by overwriting it with a new character. The second is the > > user deletes selected text by pressing backspace/delete, and then enters > > a new character. I thought this would be fairly easy, but I've been > > trying to figure it out for awhile and haven't gotten anywhere. Does > > anyone have any ideas for how I could accomplish this? > > Can you go into more details in which context you need that information? > > Cheers, > Frank > > > > ___ > Geany-devel mailing list > Geany-devel@uvena.de > https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel > > ___ Geany-devel mailing list Geany-devel@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
Re: [Geany-devel] (no subject)
Am 01.12.2011 20:57, schrieb Meyer: > I have two possible situations that I need to differentiate between, and > I'm not sure how to do it - The first situation is the user deletes > selected text by overwriting it with a new character. The second is the > user deletes selected text by pressing backspace/delete, and then enters > a new character. I thought this would be fairly easy, but I've been > trying to figure it out for awhile and haven't gotten anywhere. Does > anyone have any ideas for how I could accomplish this? Can you go into more details in which context you need that information? Cheers, Frank signature.asc Description: OpenPGP digital signature ___ Geany-devel mailing list Geany-devel@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
[Geany-devel] (no subject)
Hi, I have two possible situations that I need to differentiate between, and I'm not sure how to do it - The first situation is the user deletes selected text by overwriting it with a new character. The second is the user deletes selected text by pressing backspace/delete, and then enters a new character. I thought this would be fairly easy, but I've been trying to figure it out for awhile and haven't gotten anywhere. Does anyone have any ideas for how I could accomplish this? Thanks, Alex ___ Geany-devel mailing list Geany-devel@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
Re: [Geany-devel] (no subject)
Am Donnerstag, den 28.10.2010, 20:45 +0200 schrieb Frank Lanitz: > On Thu, 28 Oct 2010 11:24:26 -0700 (PDT) > Sergey Terlemezyan wrote: > > > Could you tell me how can I add my own plugin to the available > > plugins list? > > If you are talking about plugins.geany.org can you give some more > details about the plugin? Once we do have this I guess we can add > something. Just in case we're really talking about the website plugins.geany.org here, I'd also recommend to have a look at http://plugins.geany.org/README.html. Regards, Dominic -- Dominic Hopf http://dominichopf.de/ Key Fingerprint: A7DF C4FC 07AE 4DDC 5CA0 BD93 AAB0 6019 CA7D 868D signature.asc Description: This is a digitally signed message part ___ Geany-devel mailing list Geany-devel@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
Re: [Geany-devel] (no subject)
On Thu, 28 Oct 2010 11:24:26 -0700 (PDT) Sergey Terlemezyan wrote: > Could you tell me how can I add my own plugin to the available > plugins list? If you are talking about plugins.geany.org can you give some more details about the plugin? Once we do have this I guess we can add something. Cheers, Frank -- http://frank.uvena.de/en/ pgpBDStMwZj0R.pgp Description: PGP signature ___ Geany-devel mailing list Geany-devel@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
[Geany-devel] (no subject)
Could you tell me how can I add my own plugin to the available plugins list? ___ Geany-devel mailing list Geany-devel@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
[Geany-devel] (no subject)
Small SVN po.de Geany update. Have fun, maybe some better translations. Regards, Michael diff.patch Description: Binary data ___ Geany-devel mailing list Geany-devel@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
[Geany-devel] (no subject)
>And this file is missing in your patch :). sorry, I should have think to this. It's probably easier to attach it alone with this message now (see txt2tags.c). >I'm just wondering whether it isn't possible to extend the Markdown >parser to parse txt2tags files as well. it's problably possible because the txt2tags tags don't interfere with the markdown for this part. But... >This way we wouldn't need to >add yet another filetype in Geany. yet the extension for txt2tags files is different. And in case I or someone manage to write the scintilla lexer, the rest of the txt2tags syntax would interfere with the markdown one. >Your patch doesn't list any changes to Scintilla code, I didn't include it, maybe I could have done it (without the scintilla lexer)? I'm still not satisfied with my scintilla lexer, because I managed only to highlight the tags and not the text. I'll propose it in a later revision. Besides, the first time I inserted my changes, I did it on the released version 0.18, so I had to do it again with the svn version later. /* * Copyright (c) 2009, Eric Forgeot * * Based on work by Jon Strait * * This source code is released for free distribution under the terms of the * GNU General Public License. * * This module contains functions for generating tags for Txt2tags files. */ /* * INCLUDE FILES */ #include "general.h" /* must always come first */ #include #include #include "parse.h" #include "read.h" #include "vstring.h" /* * DATA DEFINITIONS */ static kindOption Txt2tagsKinds[] = { { TRUE, 'v', "variable", "sections" }, { TRUE, 's', "struct", "header1"} }; /* * FUNCTION DEFINITIONS */ /* checks if str is all the same character */ static boolean issame(const char *str) { char first = *str; while (*(++str)) { if (*str && *str != first) return FALSE; } return TRUE; } static void makeTxt2tagsTag (const vString* const name, boolean name_before) { tagEntryInfo e; initTagEntry (&e, vStringValue(name)); if (name_before) e.lineNumber--; /* we want the line before the underline chars */ e.kindName = "variable"; e.kind = 'v'; makeTagEntry(&e); } static void makeTxt2tagsTag2 (const vString* const name, boolean name_before) { tagEntryInfo e; initTagEntry (&e, vStringValue(name)); if (name_before) e.lineNumber--; e.kindName = "struct"; e.kind = 's'; makeTagEntry(&e); } static void findTxt2tagsTags (void) { vString *name = vStringNew(); const unsigned char *line; while ((line = fileReadLine()) != NULL) { int name_len = vStringLength(name); /* underlines must be the same length or more */ /*if (name_len > 0 && (line[0] == '=' || line[0] == '-') && issame((const char*) line)) { makeTxt2tagsTag(name, TRUE); }*/ if (line[0] == '=') { // vStringClear(name); vStringCatS(name, (const char *) line); vStringTerminate(name); makeTxt2tagsTag(name, FALSE); } /*else if (line[0] == "=") { vStringClear(name); vStringCatS(name, (const char *) line); vStringTerminate(name); makeTxt2tagsTag(name, FALSE); }*/ else if (line[0] == '°') { /*vStringClear(name);*/ vStringCatS(name, (const char *) line); vStringTerminate(name); makeTxt2tagsTag2(name, FALSE); } else { vStringClear (name); if (! isspace(*line)) vStringCatS(name, (const char*) line); vStringTerminate(name); } } vStringDelete (name); } extern parserDefinition* Txt2tagsParser (void) { static const char *const patterns [] = { "*.t2t", NULL }; static const char *const extensions [] = { "t2t", NULL }; parserDefinition* const def = parserNew ("Txt2tags"); def->kinds = Txt2tagsKinds; def->kindCount = KIND_COUNT (Txt2tagsKinds); def->patterns = patterns; def->extensions = extensions; def->parser = findTxt2tagsTags; return def; } ___ Geany-devel mailing list Geany-devel@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel