`geany.activate()` is supposed activate a document and return true.  If it is 
unable, it returns false.  However, it is not activating the document.  
Accepted arguments are a tab id (negative numbers), document id (positive 
numbers), or full document path.  Test code attempting to call 
`geany.activate()` with the document id (test1) and path (test2) follows:
```
  test1 = geany.activate(geany.documents(geany.filename()))

  doc_id = geany.documents(geany.filename())
  test2 = geany.activate(doc_id)

  for key,val in pairs({ test1, test2 }) do
    if val then
      geany.status("true")
    else
      geany.status("false")
      geany.status(geany.documents(geany.filename()))
      geany.status(geany.filename())
    end
  end
```
Results in status window are:
```
false
1
/tmp/test
false
1
/tmp/test
```

For reference, an excerpt from the GeanyLua 
[documentation](https://plugins.geany.org/geanylua/geanylua-ref.html#activate):

> **`geany.activate ( tab_id )`**
>
> Activates the document specified by tab_id.
>
> If `tab_id` is a number, it activates the document at that index.   A 
> positive number refers to the internal document array, and a negative number 
> refers to the (absolute) GtkNotebook index.  
> Note that the indices begin at (1) and (-1) respectively.
>
> If `tab_id` is a string, the function will try to activate the notebook tab 
> whose filename matches that string.  
> ( The full pathname is required! )
>
> Returns `true` on success, or `false` if the tab could not be found. 


-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/issues/1229
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany-plugins/issues/1...@github.com>

Reply via email to