Skip to content

Commit 5099025

Browse files
Alexmac22347XVilka
authored andcommitted
fix ctrl-c on calendar insert message causing uncaught exception
1 parent 3069147 commit 5099025

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ftplugin/org.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ fun CalendarAction(day, month, year, week, dir)
162162
" goto previous window
163163
exe "wincmd p"
164164
exe s:py_version . "timestamp = '" . g:org_timestamp_template . "' % newdate"
165-
exe s:py_version . "insert_at_cursor(timestamp)"
165+
exe s:py_version . "if modifier != None: insert_at_cursor(timestamp)"
166166
" restore calendar_action
167167
let g:calendar_action = g:org_calendar_action_backup
168168
endf

ftplugin/orgmode/_vim.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ def get_user_input(message):
138138
u"""Print the message and take input from the user.
139139
Return the input or None if there is no input.
140140
"""
141-
vim.command(u_encode(u'call inputsave()'))
142-
vim.command(u_encode(u"let user_input = input('" + message + u": ')"))
143-
vim.command(u_encode(u'call inputrestore()'))
144141
try:
142+
vim.command(u_encode(u'call inputsave()'))
143+
vim.command(u_encode(u"let user_input = input('" + message + u": ')"))
144+
vim.command(u_encode(u'call inputrestore()'))
145145
return u_decode(vim.eval(u_encode(u'user_input')))
146146
except:
147147
return None

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy