RefactoringRope/RefactoringServer.py

branch
server_client_variant
changeset 217
874115c79ca7
parent 212
f05681349336
child 245
75a35a927952
equal deleted inserted replaced
216:47fb0119f0be 217:874115c79ca7
881 character. 881 character.
882 882
883 Note: rope seems to convert all EOL styles to just \n. 883 Note: rope seems to convert all EOL styles to just \n.
884 884
885 @param editor reference to the editor 885 @param editor reference to the editor
886 @type QScintilla.Editor 886 @type QScintilla.Editor.Editor
887 @param line line for the offset 887 @param line line for the offset
888 @type int 888 @type int
889 @param index index into line for the offset 889 @param index index into line for the offset
890 @type int 890 @type int
891 @return rope compliant offset into the file 891 @return rope compliant offset into the file
1752 and go to it. 1752 and go to it.
1753 1753
1754 Note: This is executed upon a mouse click sequence. 1754 Note: This is executed upon a mouse click sequence.
1755 1755
1756 @param editor reference to the calling editor 1756 @param editor reference to the calling editor
1757 @type QScintilla.Editor 1757 @type QScintilla.Editor.Editor
1758 """ 1758 """
1759 if self.__projectopen: 1759 if self.__projectopen:
1760 filename = editor.getFileName() 1760 filename = editor.getFileName()
1761 line, index = editor.getCursorPosition() 1761 line, index = editor.getCursorPosition()
1762 offset = self.__getOffset(editor, line, index) 1762 offset = self.__getOffset(editor, line, index)
2123 def confirmBufferIsSaved(self, editor): 2123 def confirmBufferIsSaved(self, editor):
2124 """ 2124 """
2125 Public method to check, if an editor has unsaved changes. 2125 Public method to check, if an editor has unsaved changes.
2126 2126
2127 @param editor reference to the editor to be checked 2127 @param editor reference to the editor to be checked
2128 @type QScintilla.Editor 2128 @type QScintilla.Editor.Editor
2129 @return flag indicating, that the editor doesn't contain 2129 @return flag indicating, that the editor doesn't contain
2130 unsaved edits 2130 unsaved edits
2131 @rtype bool 2131 @rtype bool
2132 """ 2132 """
2133 res = editor.checkDirty() 2133 res = editor.checkDirty()
2262 def connectEditor(self, editor): 2262 def connectEditor(self, editor):
2263 """ 2263 """
2264 Public method to connect an editor. 2264 Public method to connect an editor.
2265 2265
2266 @param editor reference to the editor 2266 @param editor reference to the editor
2267 @type QScintilla.Editor 2267 @type QScintilla.Editor.Editor
2268 """ 2268 """
2269
2270 if self.__plugin.getPreferences("MouseClickEnabled"): 2269 if self.__plugin.getPreferences("MouseClickEnabled"):
2271 self.__disconnectMouseClickHandler(editor) 2270 self.__disconnectMouseClickHandler(editor)
2272 self.__connectMouseClickHandler(editor) 2271 self.__connectMouseClickHandler(editor)
2273 2272
2274 def disconnectEditor(self, editor): 2273 def disconnectEditor(self, editor):
2275 """ 2274 """
2276 Public method to disconnect an editor. 2275 Public method to disconnect an editor.
2277 2276
2278 @param editor reference to the editor 2277 @param editor reference to the editor
2279 @type QScintilla.Editor 2278 @type QScintilla.Editor.Editor
2280 """ 2279 """
2281 self.__disconnectMouseClickHandler(editor) 2280 self.__disconnectMouseClickHandler(editor)
2282 2281
2283 def __connectMouseClickHandler(self, editor): 2282 def __connectMouseClickHandler(self, editor):
2284 """ 2283 """
2285 Private method to connect the mouse click handler to an editor. 2284 Private method to connect the mouse click handler to an editor.
2286 2285
2287 @param editor reference to the editor 2286 @param editor reference to the editor
2288 @type QScintilla.Editor 2287 @type QScintilla.Editor.Editor
2289 """ 2288 """
2290 if self.__plugin.getPreferences("MouseClickGotoButton"): 2289 if self.__plugin.getPreferences("MouseClickGotoButton"):
2291 editor.setMouseClickHandler( 2290 editor.setMouseClickHandler(
2292 "rope", 2291 "rope",
2293 self.__plugin.getPreferences("MouseClickGotoModifiers"), 2292 self.__plugin.getPreferences("MouseClickGotoModifiers"),
2298 def __disconnectMouseClickHandler(self, editor): 2297 def __disconnectMouseClickHandler(self, editor):
2299 """ 2298 """
2300 Private method to disconnect the mouse click handler from an editor. 2299 Private method to disconnect the mouse click handler from an editor.
2301 2300
2302 @param editor reference to the editor 2301 @param editor reference to the editor
2303 @type QScintilla.Editor 2302 @type QScintilla.Editor.Editor
2304 """ 2303 """
2305 editor.removeMouseClickHandlers("rope") 2304 editor.removeMouseClickHandlers("rope")

eric ide

mercurial