You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Install micro and run plugin install snippets command.
Open any .go file (e. g. micro main.go) and put the following text (make sure lf is indented with a tab):
package main
funcmain() {
lf
}
Place cursor right to lf and run the snippetinsert command (or use Alt-S).
Result: it says Unknown snippet "lf"
Expected behavior: lf expands to log.Printf("%s", var)
I looked through the snippets.lua code. It seems that the CursorWord function is problematic. It looks back for a word until it encounters a space (literally: if (r == " ") then) or beginning of the line. But in go they use tabs for indents. So it captures \tlf as a snippet name.
I think it should check for any white space, not just "space".
The text was updated successfully, but these errors were encountered:
Steps to reproduce:
plugin install snippets
command.micro main.go
) and put the following text (make surelf
is indented with a tab):lf
and run thesnippetinsert
command (or useAlt-S
).Result: it says
Unknown snippet "lf"
Expected behavior:
lf
expands tolog.Printf("%s", var)
I looked through the
snippets.lua
code. It seems that theCursorWord
function is problematic. It looks back for a word until it encounters a space (literally:if (r == " ") then
) or beginning of the line. But in go they use tabs for indents. So it captures\tlf
as a snippet name.I think it should check for any white space, not just "space".
The text was updated successfully, but these errors were encountered: