Try to fix issue #297.
At least it doesn't crash anymore for me. It seems to be an off by one. Strangely enough, TranslationUnit.reparse and TranslationUnit.from_source are not affected, and when adding the "+ 1", they do not behave correctly. Maybe it's a bug in libclang?
|@@ -2255,7 +2255,7 @@ def codeComplete(self, path, line, column, unsaved_files=None,|
|raise TypeError,'Unexpected unsaved file contents.'|
|unsaved_files_array[i].name = name|
|unsaved_files_array[i].contents = value|
|- unsaved_files_array[i].length = len(value)|
|+ unsaved_files_array[i].length = len(value) + 1|
|ptr = conf.lib.clang_codeCompleteAt(self, path, line, column,|
|unsaved_files_array, len(unsaved_files), options)|