-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
Steps to reproduce:
- Install micro and run
plugin install snippetscommand. - Open any .go file (e. g.
micro main.go) and put the following text (make surelfis indented with a tab):
package main
func main() {
lf
}- Place cursor right to
lfand run thesnippetinsertcommand (or useAlt-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".
Metadata
Metadata
Assignees
Labels
No labels