Skip to content

Commit

Permalink
Issue #15: Show status message when the code has been trimmed.
Browse files Browse the repository at this point in the history
  • Loading branch information
gh640 committed Jul 14, 2018
1 parent a8b08f5 commit 6372601
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion carbonSublime.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import sublime_plugin

SETTINGS_FILE = 'carbonSublime.sublime-settings'
CODE_MAX_LENGTH = 3400

# Carbon language mapping
LANGUAGE_MAPPING = {
Expand Down Expand Up @@ -118,7 +119,11 @@ def normalize_code(self):

body = convert_tabs_using_tab_size(view, body.strip())

body = body[0:3400]
if len(body) > CODE_MAX_LENGTH:
body = body[:CODE_MAX_LENGTH]
view.window().status_message(
'carbonSublime: The code was trimmed to {}.'.format(CODE_MAX_LENGTH)
)

# create the final code that will be sent to the carbon.sh website
for line in body.splitlines():
Expand Down

0 comments on commit 6372601

Please sign in to comment.