I wonder if there is any way how to access jEdit variables (like the buffer variable) from the beanshell inside SuperAbbrevs plugin template.
When I try to expand following template, the error Attempt to resolve method: getName() on undefined variable or class name: buffer
appears int Activity log.
<#= buffer.getName() #>
When I try to run this code in the BeanShell console then it displays the current buffer name:
buffer.getName()
Is it possible to access buffer name from the SuperAbbrevs template?
As far as I can see from a quick look at that plugins sources, those variables are not forwarded to the templates. Only the variables you define in the options of the plugin and additionally filename
and selection
.
In your example filename
is exactly what you want, so <#= filename #>
works for inserting the name of the file. If you would need more, you would probably need to issue a plugin feature request.