Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ __Optional ~/.vimrc Variables:__
* let g:vimchat\_buddylistmaxwidth = max width of buddy list window, default ''
* let g:vimchat\_timestampformat = format of the message timestamp, default "[%H:%M]"
* let g:vimchat\_showPresenceNotification = notification if buddy changed status, comma-separated list of states, default ""
* let g:vimchat\_statusAutoCompletion = (0 or 1), default is 1

# Hacking

* Keep all lines to 80 characters wide or less
* All python code should follow pep8 guidelines
* All new features should update documentation in the README


# Contributors

* Philipp [philsmd](https://github.com/philsmd)
Expand Down
20 changes: 19 additions & 1 deletion plugin/vimchat.vim
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
" g:vimchat_timestampformat = format of the msg timestamp default "[%H:%M]"
" g:vimchat_showPresenceNotification =
" notify if buddy changed status default ""
" g:vimchat_statusAutoCompletion = (0 or 1) default is 1

python <<EOF
try:
Expand Down Expand Up @@ -1458,9 +1459,23 @@ class VimChatScope:
vim.command('normal G')

def setStatus(self, status=None):
if not self.accounts:
print "Not Connected! Please connect first."
return 0
if not status:
statusCompletion = ''
if int(vim.eval("g:vimchat_statusAutoCompletion"))==1:
firstAccount = self.accounts.itervalues().next()
if firstAccount != None:
[oldShow,oldStatus] = firstAccount.jabberGetPresence()

if oldShow != None and str(oldShow) != "None":
statusCompletion = str(oldShow)
if oldStatus != None and str(oldStatus) != "None":
statusCompletion += ','+str(oldStatus)
status = str(vim.eval(
'input("Status: (away,xa,dnd,chat),message,priority: ")'))
'input("Status: (away,xa,dnd,chat),message,priority: ",'+
'"'+statusCompletion+'")'))

parts = status.split(',')
show = parts[0]
Expand Down Expand Up @@ -1727,6 +1742,9 @@ fu! VimChatCheckVars()
if !exists('g:vimchat_showPresenceNotification')
let g:vimchat_showPresenceNotification=""
endif
if !exists('g:vimchat_statusAutoCompletion')
let g:vimchat_statusAutoCompletion=1
endif

return 1
endfu
Expand Down