Build request for the current buffer or the buffer with number |buffer_number| if specified.
( buffer_number = None )
| 218 | |
| 219 | |
| 220 | def BuildRequestData( buffer_number = None ): |
| 221 | """Build request for the current buffer or the buffer with number |
| 222 | |buffer_number| if specified.""" |
| 223 | working_dir = GetCurrentDirectory() |
| 224 | current_buffer = vim.current.buffer |
| 225 | |
| 226 | if buffer_number and current_buffer.number != buffer_number: |
| 227 | # Cursor position is irrelevant when filepath is not the current buffer. |
| 228 | buffer_object = vim.buffers[ buffer_number ] |
| 229 | filepath = vimsupport.GetBufferFilepath( buffer_object ) |
| 230 | return { |
| 231 | 'filepath': filepath, |
| 232 | 'line_num': 1, |
| 233 | 'column_num': 1, |
| 234 | 'working_dir': working_dir, |
| 235 | 'file_data': vimsupport.GetUnsavedAndSpecifiedBufferData( buffer_object, |
| 236 | filepath ) |
| 237 | } |
| 238 | |
| 239 | current_filepath = vimsupport.GetBufferFilepath( current_buffer ) |
| 240 | line, column = vimsupport.CurrentLineAndColumn() |
| 241 | |
| 242 | return { |
| 243 | 'filepath': current_filepath, |
| 244 | 'line_num': line + 1, |
| 245 | 'column_num': column + 1, |
| 246 | 'working_dir': working_dir, |
| 247 | 'file_data': vimsupport.GetUnsavedAndSpecifiedBufferData( current_buffer, |
| 248 | current_filepath ) |
| 249 | } |
| 250 | |
| 251 | |
| 252 | def BuildRequestDataForLocation( file : str, line : int, column : int ): |
no outgoing calls