moo.Editor - editor object
Prev | Chapter 1. medit Lua API | Next

## moo.Editor - editor object

    gtk.GObject
      |
      +-- moo.Editor

### signal after-save

    after-save(doc)

This signal is emitted after the document has been successfully saved on disk.

`doc` : | the document which was saved on disk

### signal before-save

    before-save(doc, file)

This signal is emitted when the document is going to be saved on disk. Callbacks must return `SAVE_RESPONSE_CANCEL` if document should not be saved, and `SAVE_RESPONSE_CONTINUE` otherwise. For example, if before saving the file must be checked out from a version control system, a callback can do that and return `SAVE_RESPONSE_CANCEL` if checkout failed. Callbacks must not modify document content. If you need to modify it before saving, use `will-save` signal instead.

`doc` : | the document which is about to be saved on disk
`file` : | the `gtk.GFile` object which represents saved file

`Returns:` `SAVE_RESPONSE_CANCEL` to cancel saving, `SAVE_RESPONSE_CONTINUE` otherwise.

### signal will-close-doc

    will-close-doc(doc)

This signal is emitted before the document is closed.

`doc` : | the document which is about to be closed

`Returns:` `moo.CloseResponse`

### signal will-close-window

    will-close-window(window)

This signal is emitted before the window is closed.

`window` : | the window which is about to be closed

### signal will-save

    will-save(doc, file)

This signal is emitted when the document is going to be saved on disk, after `before-save` signal. Callbacks may modify document content at this point.

`doc` : | the document which is about to be saved on disk
`file` : | the `gtk.GFile` object which represents saved file

### instance()

    Editor.instance()

`Returns:` `moo.Editor`

### close_doc()

    editor.close_doc(doc)

`doc` : | `moo.Edit`

`Returns:` `bool`

### close_docs()

    editor.close_docs(docs)

`docs` : | list of `moo.Edit` objects

`Returns:` `bool`

### close_window()

    editor.close_window(window)

`window` : | `moo.EditWindow`

`Returns:` `bool`

### get_active_doc()

    editor.get_active_doc()

`Returns:` `moo.Edit`

### get_active_view()

    editor.get_active_view()

`Returns:` `moo.EditView`

### get_active_window()

    editor.get_active_window()

`Returns:` `moo.EditWindow`

### get_doc()

    editor.get_doc(filename)

Finds open document by filename.

`filename` : | `string`

`Returns:` `moo.Edit`

### get_doc_for_file()

    editor.get_doc_for_file(file)

Finds open document by `gtk.GFile`.

`file` : | `gtk.GFile`

`Returns:` `moo.Edit`

### get_doc_for_uri()

    editor.get_doc_for_uri(uri)

Finds open document by URI.

`uri` : | `string`

`Returns:` `moo.Edit`

### get_docs()

    editor.get_docs()

`Returns:` list of `moo.Edit` objects

### get_windows()

    editor.get_windows()

`Returns:` list of `moo.EditWindow` objects

### new_doc()

    editor.new_doc(window=nil)

`window` : | `moo.EditWindow` or `nil`

`Returns:` `moo.Edit`

### new_file()

    editor.new_file(info, parent=nil)

`info` : | `moo.OpenInfo`
`parent` : | `gtk.Widget` or `nil`

`Returns:` `moo.Edit`

### new_window()

    editor.new_window()

`Returns:` `moo.EditWindow`

### open_file()

    editor.open_file(info, parent=nil)

`info` : | `moo.OpenInfo`
`parent` : | `gtk.Widget` or `nil`

`Returns:` `moo.Edit`

### open_files()

    editor.open_files(files, parent=nil)

`files` : | list of `moo.OpenInfo` objects
`parent` : | `gtk.Widget` or `nil`

`Returns:` `bool`

### open_path()

    editor.open_path{path, encoding=nil, line=-1, window=nil}

`path` : | `string`
`encoding` : | `string` or `nil`
`line` : | `integer`
`window` : | `moo.EditWindow` or `nil`

`Returns:` `moo.Edit`

### open_uri()

    editor.open_uri{uri, encoding=nil, line=-1, window=nil}

`uri` : | `string`
`encoding` : | `string` or `nil`
`line` : | `integer`
`window` : | `moo.EditWindow` or `nil`

`Returns:` `moo.Edit`

### reload()

    editor.reload(doc, info=nil)

`doc` : | `moo.Edit`
`info` : | `moo.ReloadInfo` or `nil`

`Returns:` `bool`

### save()

    editor.save(doc)

`doc` : | `moo.Edit`

`Returns:` `bool`

### save_as()

    editor.save_as(doc, info=nil)

Save document with new filename and/or encoding. If `info` is missing or ``nil`` then user is asked for new filename first.

`doc` : | `moo.Edit`
`info` : | `moo.SaveInfo` or `nil`

`Returns:` `bool`

### save_copy()

    editor.save_copy(doc, info)

`doc` : | `moo.Edit`
`info` : | `moo.SaveInfo`

`Returns:` `bool`

### set_active_doc()

    editor.set_active_doc(doc)

`doc` : | `moo.Edit`

### set_active_view()

    editor.set_active_view(view)

`view` : | `moo.EditView`

### set_active_window()

    editor.set_active_window(window)

`window` : | `moo.EditWindow`

Prev | Up | Next
moo.EditWindow - document window object | Home | moo.OpenInfo - information for opening a file