Part of pida.utils.vim.vimcom View In Hierarchy
This is an actual GTK window (which it must be to accurately detect property events inside the GTK main loop) but has its GDK window correctly set to receive such events. This is notably the "Vim" property which must be present and set to a version string, in this case "6.0" is used.
Line # | Kind | Name | Docs |
---|---|---|---|
205 | Method | __init__ | Constructor. |
243 | Method | fetch_serverlist | Fetch the serverlist, and if it has changed, feed it to the client. |
273 | Method | stop_fetching_serverlist | Undocumented |
276 | Method | get_rootwindow_serverlist | Get the X root window's version of the current Vim serverlist. |
313 | Method | get_shell_serverlist | DEPRACATED: WE NEVER NEED A SERVERLIST |
329 | Method | get_hidden_serverlist | DEPRACATED: WE NEVER NEED A SERVERLIST |
365 | Method | get_server_wid | Get the X Window id for a named Vim server. |
387 | Method | get_server_window | Create and return a GDK window for a given window ID. |
399 | Method | feed_serverlist | Feed the given list of servers to the client. |
413 | Method | fetch_cwd | Fetch the working directory for a named server and store the result. |
426 | Method | get_cwd | Undocumented |
430 | Method | abspath | Return the absolute path of a buffer name in the context of the named |
448 | Method | generate_message | Generate a message. |
465 | Method | parse_message | Parse a received message and return the message atributes as a |
484 | Method | send_message | Undocumented |
497 | Method | send_expr | Undocumented |
500 | Method | send_keys | Undocumented |
503 | Method | send_esc | Undocumented |
506 | Method | send_ret | Undocumented |
509 | Method | send_ex | Undocumented |
514 | Method | send_ex_via_tempfile | For really long ugly messages |
524 | Method | get_option | Undocumented |
527 | Method | foreground | Undocumented |
532 | Method | change_buffer | Undocumented |
535 | Method | change_buffer_number | Undocumented |
538 | Method | close_buffer | Undocumented |
541 | Method | close_current_buffer | Undocumented |
544 | Method | change_cursor | Undocumented |
548 | Method | save_session | Undocumented |
551 | Method | load_session | Undocumented |
554 | Method | escape_filename | Undocumented |
559 | Method | open_file | Undocumented |
562 | Method | new_file | Undocumented |
567 | Method | goto_line | Undocumented |
573 | Method | revert | Undocumented |
576 | Method | load_script | Undocumented |
579 | Method | preview_file | Undocumented |
584 | Method | get_bufferlist | Undocumented |
596 | Method | get_current_buffer | Undocumented |
604 | Method | save | Undocumented |
607 | Method | save_as | Undocumented |
611 | Method | undo | Undocumented |
615 | Method | redo | Undocumented |
619 | Method | cut | Undocumented |
622 | Method | copy | Undocumented |
625 | Method | paste | Undocumented |
629 | Method | set_colorscheme | Undocumented |
632 | Method | set_menu_visible | Undocumented |
639 | Method | quit | Undocumented |
642 | Method | define_sign | Undocumented |
651 | Method | undefine_sign | Undocumented |
654 | Method | show_sign | Undocumented |
658 | Method | hide_sign | Undocumented |
661 | Method | get_cword | Undocumented |
664 | Method | get_selection | Undocumented |
667 | Method | set_path | Undocumented |
670 | Method | cb_notify | Undocumented |
679 | Method | cb_reply | Undocumented |
688 | Method | cb_reply_async | Undocumented |
699 | Method | vim_event | Undocumented |
The Window is instantiated, the properties are correctly set, the event mask is modified, and the instance variables are initialized.
@param cb: An instance of the main Application class. @type cb: pida.main.Application.
The serverlist is requested asynchrnously, and passed the gotservers function as a callback. The gotservers function is then called with the server list, gets the appropriate working directory (if required) and feeds the new server list to the client if it has changed.
On starting with the client-server feature, GVim or Vim with the --servername option registers its server name and X window id as part of the "VimRegistry" parameter on the X root window.
This method extracts and parses that property, and returns the server list.
Note: Vim does not actually unregister itself with the root window on dying, so the presence of a server in the root window list is no gurantee that it is alive.
@return: servers @rtype servers: dict of ("server", "window id") key, value
Get the server list by starting console Vim on a Pipe.
This blocks, so we don't use it. It is one of the alternative methods of retrieving an accurate serverlist. It is slow, and expensive.
DEPRACATED: WE NEVER NEED A SERVERLIST (This is here for educative purposes) Get the serverlist from the hidden Vim instance and call the callback function with the results. This method checks first whther the Vim instance is alive, and then evaluates the serverlist() function remotely in it, with a local call back function which parses the result and calls the user-provided callback function. @param callbackfunc: The call back function to be called with the server list. @type callbackfunc: callable
This function returns the id from the root window server list, if it exists, or None if it does not.
@param servername: The name of the server @type servername: str
@return: wid @rtype wid: long
This method simply calls gdk.window_foreign_new, which should return None if the window has been destroyed, but does not, in some cases.
@param wid: The window ID. @type wid: long
This is achieved by calling the clients serverlist event. In Pida, this event is passed on to all the plugins.
@param serverlist: The list of servers. @type serverlist: list