Browse Subversion Repository
Diff of /window.rb
Parent Directory
| Revision Log
| Patch
| 256 |
end |
end |
| 257 |
end |
end |
| 258 |
|
|
| 259 |
|
#Remove the string in the current line behind the cursor and push it to |
| 260 |
|
#the kill ring. |
| 261 |
|
# |
| 262 |
|
#=== Warning |
| 263 |
|
#This method *MUST* *NOT* be overrided in derived classes. |
| 264 |
|
def kill_line |
| 265 |
|
if @cursor.column >= @buffer.lines[@cursor.row].size && |
| 266 |
|
@cursor.row == (@buffer.lines.size - 1) |
| 267 |
|
#ToDo: Alert that the cursor is at the end of this buffer. |
| 268 |
|
@view.beep |
| 269 |
|
elsif @cursor.column >= @buffer.lines[@cursor.row].size |
| 270 |
|
#Concatenate the next line into the current line. |
| 271 |
|
@buffer.lines[@cursor.row] << @buffer.lines[@cursor.row + 1] |
| 272 |
|
@buffer.lines.delete_at(@cursor.row + 1) |
| 273 |
|
@view.push_to_kill_ring("\n") |
| 274 |
|
refresh |
| 275 |
|
else |
| 276 |
|
line = @buffer.lines[@cursor.row] |
| 277 |
|
@view.push_to_kill_ring(line[@cursor.column .. -1]) |
| 278 |
|
@buffer.lines[@cursor.row] = line[0, @cursor.column] |
| 279 |
|
refresh |
| 280 |
|
end |
| 281 |
|
end |
| 282 |
|
|
| 283 |
|
#Get a certain string from kill ring and insert it at the cursor position. |
| 284 |
|
# |
| 285 |
|
#=== Warning |
| 286 |
|
#This method *MUST* *NOT* be overrided in derived classes. |
| 287 |
|
def yank |
| 288 |
|
insert_at_cursor(@view.yank_from_kill_ring) |
| 289 |
|
end |
| 290 |
|
|
| 291 |
#Redraw the cursor. |
#Redraw the cursor. |
| 292 |
# |
# |
| 293 |
#=== Warning |
#=== Warning |
|
|
Legend:
| Removed from v.24 |
|
| changed lines |
| |
Added in v.26 |
|
|
|