No I've never had this problem. Win8.1, latest Sublime Text, English keyboard. [[ worked fine for me in previous builds and when I default to vanilla Sublime installation all the auto-completion works great for me.
On a default installation < shouldn't trigger anything. If you are in source scope or in HTML and keep typing after < then you'll see some auto-complete options, for example typing <a offers me the option to choose from inserting all sorts of HTML tags, the first one being <a href=""></a>. But the trigger only happens when I have typed a character after typing the < symbol.
For me, on default installation: just typing < does nothing. It should not be triggering the files completion list.This leads me to believe that either the syntax might not be properly applied to the current buffer, or there's some kind of bug with the way auto-completion is implemented in the plugin.
I don't think this is related to the github issue you linked. The way to determine if it is or not: nuke completely your Sublime text install, install from scratch no packages, and test < in both HTML and Markdown syntax to determine the baseline behaviour on your system.
UPDATE:
After installing the latest build, typing [[ triggers the overlay, to allow me to select from the notes as usual. All is well. But typing < triggers the auto-complete popup showing me a list of notes. This is abnormal, and changed from the default functionality I mentioned above. So the plugin is somehow triggering the auto-complete popup on <. Somehow typing < has been linked to ctrl+space functionality.
@toolboxen said:
No I've never had this problem. Win8.1, latest Sublime Text, English keyboard.
Aaah, it's probably an issue with the German keyboard then. This might be related to the issue mentioned in my post. I personally only use English keyboards so I didn't notice.
[[ worked fine for me in previous builds (although it is broken in current build I'll add an error issue for you), and when I default to vanilla Sublime installation all the auto-completion works great for me.
Yeah, I broke it but it's fixed again. I had renamed the commands to have a zk_ prefix and forgot to update some lines of code that are issuing commands.
On a default installation < shouldn't trigger anything. If you are in source scope or in HTML and keep typing after < then you'll see some auto-complete options, for example typing <a offers me the option to choose from inserting all sorts of HTML tags, the first one being <a href=""></a>. But the trigger only happens when I have typed a character after typing the < symbol.
This is interesting. On Linux (I have two Linux laptos I use, one is pretty default install) completion gets triggered via <. [ctrl]+[space] has no effect. That link to the sublime documentation also mentions < for completion (in HTML & code)
For me, on default installation: just typing < does nothing. It should not be triggering the files completion list.This leads me to believe that either the syntax might not be properly applied to the current buffer, or there's some kind of bug with the way auto-completion is implemented in the plugin.
Again, on Linux it seems < is the completion key, and when the syntax is applied, it triggers the plugin's on_query_completions. This method exits if it's not in text.html.markdown just to be sure. If it is in markdown, it offers the completion list. The plugin does not choose how completion is triggered. It only responds to the event.
I don't think this is related to the github issue you linked. The way to determine if it is or not: nuke completely your Sublime text install, install from scratch no packages, and test < in both HTML and Markdown syntax to determine the baseline behaviour on your system.
The mentioned issue suggests that some key mappings don't behave well on non-(US)-English keyboards. That's why I mentioned it.
@toolboxen said:
But typing < triggers the auto-complete popup showing me a list of notes. This is abnormal, and changed from the default functionality I mentioned above. So the plugin is somehow triggering the auto-complete popup on <. Somehow typing < has been linked to ctrl+space functionality.
Interesting that it seems to work with < and [ctrl]+[space] on your system. On my Mac (pretty non-default Sublime install grown over years) only [ctrl]+[space] triggers. Maybe there is a side-effect caused by the plugin / its syntax, I agree. But it's definitely not something obvious. It does not provide anything that's actively triggering code completion afaict.
By default < and [ctrl]+[space] are slightly different functionality on any platform/OS. For a vanilla install of Sublime on any OS < doesn't trigger the popup, it only shows the popup after you start typing a second character. [ctrl]+[space] force triggers the popup manually.
After installing the plugin, now the functionality of both have merged somehow, so that < force triggers the popup just like [ctrl]+[space]
By default < and [ctrl]+[space] are slightly different functionality on any platform/OS. < doesn't trigger the popup, it only shows the popup after you start typing a second character. [ctrl]+[space] force triggers the popup manually.
After installing the plugin, now the functionality of both have merged somehow, so that < force triggers the popup just like [ctrl]+[space]
I found it!
In my defaullt preferences (I did not put this in, it's maybe a recent addition that affects recent versions of SublimeText):
/ Additional situations to trigger auto complete
"auto_complete_triggers": [ {"selector": "text.html", "characters": "<"} ],
As our scope is text.html.markdown we get triggered! You might have a similar setting?
That setting has been there since Sublime Text 2, it's a special case to allow HTML tag completion to be present in text scope, whereas normally HTML tag completion would only be present in source scope.
So maybe the plugin is being too greedy to see this trigger as being the same type of trigger as ctrl+space?
And just for the sake of completeness I mention it here: [ctrl]+[space] does not work on Linux's SublimeText default install for triggering completion. That has been disabled on purpose. See https://github.com/SublimeTextIssues/Core/issues/1251
Sure, but that doesn't solve the problem of default < functionality changing when the plugin is installed. and after removing plugin, the < functionality reverts back to default.
@toolboxen said:
That setting has been there since Sublime Text 2, it's a special case to allow HTML tag completion to be present in text scope, whereas normally HTML tag completion would only be present in source scope.
So maybe the plugin is being too greedy to see this trigger as being the same type of trigger as ctrl+space?
The plugin has no control over triggering completion. It gets asked if it can contribute to the completion list when sublime triggers the completion
See my previous post: text.html in combination with < triggers completion. Since we use standard markdown, our scope is text.html.markdown which is a subset of text.html so sublime triggers autocomplete. Has nothing to do with greediness of the plugin.
The plugin is not told what key triggered the call to on query_completions
@toolboxen the reason why you might not get completions in markdown docs when you type < is: there is no plugin responding to it. Our plugin, however, does respond. Again, the plugin cannot see what triggered it.
See my previous post: text.html in combination with < triggers completion.
It doesn't by default. I am uploading some GIFs on github for you to see what I'm seeing from vanilla Sublime install and then after installing the plugin.
@toolboxen the reason why you might not get completions in markdown docs when you type < is: there is no plugin responding to it. Our plugin, however, does respond. Again, the plugin cannot see what triggered it.
I see. Well, I'm assuming it shouldn't be responding. And it didn't used to until recently. When I first test the plugin, I tested < completion versus file completion and they were two separate functions but now < is triggering file completions as well as HTML tag completion.
I should have mentioned that sooner, sorry I forgot to mention I noticed a difference over course of plugin development.
See my previous post: text.html in combination with < triggers completion.
It doesn't by default. I am uploading some GIFs on github for you to see what I'm seeing from vanilla Sublime install and then after installing the plugin.
It does by default. Sorry. But it's in Preferences.sublime-settings --- (Default) then I consider it by default. The setting clearly mentions the < key and the text.html scope.
I see. Well, I'm assuming it shouldn't be responding. And it didn't used to until recently. When I first test the plugin, I tested < completion versus file completion and they were two separate functions but now < is triggering file completions as well as HTML tag completion.
I think it should respond because: When we say we want to support auto_complete to bring up a note picker, then we have to live with it that Sublime triggers on the < key because it treats markdown as HTML, as defined by the syntax.
I understand that you mean you didn't see this in previous versions of the plugin. But I am doubting my memories here. Maybe you/we assumed it didn't trigger and we never saw it trigger because we never pressed < in a text.html.markdown scope?
Only way to find out is to use, like, the first commit that introduced the completion and test it again
To clarify: by default just pressing < doesn't trigger the auto-complete popup. Only after pressing < then some letter.
Sorry. I see it differently. The DEFAULT setting clearly states:
scope: text.html
character to trigger auto-completion: <
So it does get triggered, nowhere does it say: and wait for 1 more character. In my point of view: other/default plugins just choose to not bring up the popup immediately but rather wait.
@rene said:
In my point of view: other/default plugins just choose to not bring up the popup immediately but rather wait.
That's the problem. I have no other plugins installed. So we're comparing Sublime text vanilla functionality to the functionality I immediately get when installing the plugin. And that was the original issue as reported by @wangeleile on Github. < should not be triggering any action by itself, it is not actually a keybind.
If you don't think this is an issue, then no problem with me. I just try to provide whatever information or context I can to help solve the problem. But if not a problem, then no problem!
Ah, OK, our terminology. For me trigger was: triggering the event. for everybody else it was: triggering the popup as a consequence of the handled and not ignored event.
Of course I am trying to fix this, especially after all this discussion
Ah, OK, our terminology. For me trigger was: triggering the event. for everybody else it was: triggering the popup as a consequence of the handled and not ignored event.
That makes sense! I understand now.
Of course I am trying to fix this, especially after all this discussion
Currently it isn't a template but it is hardcoded in sublime_zk.py at line 182:
f.write(u'# {}\ntags = \n\n'.format(title))
Currently the function create_note() receives only 2 parameters: title and file name (which also contains the note id). I can work on some template function. Should be fairly easy to do with python format strings. Will let you know.
@rene said:
Currently the function create_note() receives only 2 parameters: title and file name (which also contains the note id). I can work on some template function. Should be fairly easy to do with python format strings. Will let you know.
Ah ok. So you know what I'm looking for, my files currently have the format
---
uid: 201711150402
tags: #foo, #bar
---
This is, as far as I know, standard formatting for YAML metadata. The --- helps some markdown parsers differentiate metadata, and the keyword: value format is more standardized than keyword = value that yours produces now.
It might be useful to be able to add additional keywords. For a while I had an author: myname field. That became redundant, but if we do figure out a good methodology for sharing and publishing, I suspect people will want to add that in. Several other examples, of course, leap to mind.
@mediapathic said:
Ah ok. So you know what I'm looking for, my files currently have the format
---
uid: 201711150402
tags: #foo, #bar
---
That's easy enough to do. I think I'll make it a setting.
It might be useful to be able to add additional keywords. For a while I had an author: myname field. That became redundant, but if we do figure out a good methodology for sharing and publishing, I suspect people will want to add that in. Several other examples, of course, leap to mind.
That will be trickier because how is the plugin supposed to know what myname is? Would probably need to be configured. But if it's fixed, it can be put in the template directly
That will be trickier because how is the plugin supposed to know what myname is? Would probably need to be configured. But if it's fixed, it can be put in the template directly
Oh, yeah, no, I was thinking the template would just allow you to have more keyword:s created automatically. Filling them in would be manual, like tags are now.
Comments
No I've never had this problem. Win8.1, latest Sublime Text, English keyboard.
[[
worked fine for me in previous builds and when I default to vanilla Sublime installation all the auto-completion works great for me.On a default installation
<
shouldn't trigger anything. If you are in source scope or in HTML and keep typing after<
then you'll see some auto-complete options, for example typing<a
offers me the option to choose from inserting all sorts of HTML tags, the first one being<a href=""></a>
. But the trigger only happens when I have typed a character after typing the<
symbol.For me, on default installation: just typing
<
does nothing. It should not be triggering the files completion list.This leads me to believe that either the syntax might not be properly applied to the current buffer, or there's some kind of bug with the way auto-completion is implemented in the plugin.I don't think this is related to the github issue you linked. The way to determine if it is or not: nuke completely your Sublime text install, install from scratch no packages, and test
<
in both HTML and Markdown syntax to determine the baseline behaviour on your system.UPDATE:
After installing the latest build, typing
[[
triggers the overlay, to allow me to select from the notes as usual. All is well. But typing<
triggers the auto-complete popup showing me a list of notes. This is abnormal, and changed from the default functionality I mentioned above. So the plugin is somehow triggering the auto-complete popup on<
. Somehow typing<
has been linked toctrl+space
functionality.Aaah, it's probably an issue with the German keyboard then. This might be related to the issue mentioned in my post. I personally only use English keyboards so I didn't notice.
Yeah, I broke it but it's fixed again. I had renamed the commands to have a
zk_
prefix and forgot to update some lines of code that are issuing commands.This is interesting. On Linux (I have two Linux laptos I use, one is pretty default install) completion gets triggered via
<
.[ctrl]+[space]
has no effect. That link to the sublime documentation also mentions<
for completion (in HTML & code)Again, on Linux it seems
<
is the completion key, and when the syntax is applied, it triggers the plugin'son_query_completions
. This method exits if it's not intext.html.markdown
just to be sure. If it is in markdown, it offers the completion list. The plugin does not choose how completion is triggered. It only responds to the event.The mentioned issue suggests that some key mappings don't behave well on non-(US)-English keyboards. That's why I mentioned it.
@rene sorry, I updated my previous post, please see update.
Interesting that it seems to work with
<
and[ctrl]+[space]
on your system. On my Mac (pretty non-default Sublime install grown over years) only[ctrl]+[space]
triggers. Maybe there is a side-effect caused by the plugin / its syntax, I agree. But it's definitely not something obvious. It does not provide anything that's actively triggering code completion afaict.Not quite.
By default
<
and[ctrl]+[space]
are slightly different functionality on any platform/OS. For a vanilla install of Sublime on any OS<
doesn't trigger the popup, it only shows the popup after you start typing a second character.[ctrl]+[space]
force triggers the popup manually.After installing the plugin, now the functionality of both have merged somehow, so that
<
force triggers the popup just like[ctrl]+[space]
I found it!
In my defaullt preferences (I did not put this in, it's maybe a recent addition that affects recent versions of SublimeText):
As our scope is
text.html.markdown
we get triggered! You might have a similar setting?That setting has been there since Sublime Text 2, it's a special case to allow HTML tag completion to be present in
text
scope, whereas normally HTML tag completion would only be present insource
scope.So maybe the plugin is being too greedy to see this trigger as being the same type of trigger as
ctrl+space
?And just for the sake of completeness I mention it here:
[ctrl]+[space]
does not work on Linux's SublimeText default install for triggering completion. That has been disabled on purpose. See https://github.com/SublimeTextIssues/Core/issues/1251Sure, but that doesn't solve the problem of default
<
functionality changing when the plugin is installed. and after removing plugin, the<
functionality reverts back to default.text.html
in combination with<
triggers completion. Since we use standard markdown, our scope istext.html.markdown
which is a subset oftext.html
so sublime triggers autocomplete. Has nothing to do with greediness of the plugin.on query_completions
@toolboxen the reason why you might not get completions in markdown docs when you type
<
is: there is no plugin responding to it. Our plugin, however, does respond. Again, the plugin cannot see what triggered it.It doesn't by default. I am uploading some GIFs on github for you to see what I'm seeing from vanilla Sublime install and then after installing the plugin.
I see. Well, I'm assuming it shouldn't be responding. And it didn't used to until recently. When I first test the plugin, I tested
<
completion versus file completion and they were two separate functions but now<
is triggering file completions as well as HTML tag completion.I should have mentioned that sooner, sorry I forgot to mention I noticed a difference over course of plugin development.
It does by default. Sorry. But it's in
Preferences.sublime-settings --- (Default)
then I consider it by default. The setting clearly mentions the<
key and thetext.html
scope.I think it should respond because: When we say we want to support auto_complete to bring up a note picker, then we have to live with it that Sublime triggers on the
<
key because it treats markdown as HTML, as defined by the syntax.I understand that you mean you didn't see this in previous versions of the plugin. But I am doubting my memories here. Maybe you/we assumed it didn't trigger and we never saw it trigger because we never pressed
<
in atext.html.markdown
scope?Only way to find out is to use, like, the first commit that introduced the completion and test it again
To clarify: by default just pressing
<
doesn't trigger the auto-complete popup. Only after pressing<
then some letter.I'm a heavy user of Sublime and so pressed it a multitude of times
Sure, also perhaps you might test the default
<
functionality on LInux just to get a Linux baseline. I got one in Windows here: https://github.com/renerocksai/sublime_zk/issues/21#issuecomment-344531018Sorry. I see it differently. The DEFAULT setting clearly states:
So it does get triggered, nowhere does it say: and wait for 1 more character. In my point of view: other/default plugins just choose to not bring up the popup immediately but rather wait.
That's the problem. I have no other plugins installed. So we're comparing Sublime text vanilla functionality to the functionality I immediately get when installing the plugin. And that was the original issue as reported by @wangeleile on Github.
<
should not be triggering any action by itself, it is not actually a keybind.So when I set everything back to default, and when that default setting is applying to my vanilla install I get this functionality:
So at least on my system of Windows with a default vanilla install the default setting expresses itself in that functionality.
If you don't think this is an issue, then no problem with me. I just try to provide whatever information or context I can to help solve the problem. But if not a problem, then no problem!
Ah, OK, our terminology. For me trigger was: triggering the event. for everybody else it was: triggering the popup as a consequence of the handled and not ignored event.
Of course I am trying to fix this, especially after all this discussion
Aha! I see now. > @rene said:
That makes sense! I understand now.
Thank you!!
done
(phew )
uh, body was 5 characters short so here comes some more text. My favourite character is <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<,
Nice. Just tested, and works great now. Thanks again!
You're welcome and thx for being persistent
Bumping this because I think it got lost when I ps'd it at the end of something more interesting:
@mediapathic good you bumped this!
Currently it isn't a template but it is hardcoded in
sublime_zk.py
at line 182:Currently the function create_note() receives only 2 parameters: title and file name (which also contains the note id). I can work on some template function. Should be fairly easy to do with python format strings. Will let you know.
Ah ok. So you know what I'm looking for, my files currently have the format
This is, as far as I know, standard formatting for YAML metadata. The
---
helps some markdown parsers differentiate metadata, and thekeyword: value
format is more standardized thankeyword = value
that yours produces now.It might be useful to be able to add additional
keyword
s. For a while I had anauthor: myname
field. That became redundant, but if we do figure out a good methodology for sharing and publishing, I suspect people will want to add that in. Several other examples, of course, leap to mind.That's easy enough to do. I think I'll make it a setting.
That will be trickier because how is the plugin supposed to know what myname is? Would probably need to be configured. But if it's fixed, it can be put in the template directly
Will let you know when it's finished.
Oh, yeah, no, I was thinking the template would just allow you to have more
keyword:
s created automatically. Filling them in would be manual, like tags are now.Great! Thanks!
@mediapathic
New note templates are here. In your package's settings (user) just put in a line like this:
\n
creates a new line.{id}
: the note id like201712241830
{title}
: note title likeWhy we should celebrate Christmas
{file}
: the filename of the note like201712241830 Why we should celebrate Christmas.md
{path}
: the path of the note like/home/reschal/Dropbox/Zettelkasten
Hope this is useful
Do you... do you ever sleep?