نديم ابن ﺤﻣﻮﺪﺓ الخمير - Nadim Khemir > Text-Editor-Vip > Text::Editor::Vip::Buffer::Plugins::InsertConstruct

Download:
Text-Editor-Vip-0.08.1.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.01   Source  

NAME ^

Text::Editor::Vip::Buffer::Plugins::InsertConstruct- Vip::Buffer plugin

SYNOPSIS ^

  $buffer->InsertAlignedWithTab("XXXXX") ;

  $buffer->Insert($text) ;
  $buffer->SetModificationPosition(0, 4) ;
  $buffer->SetSelectionBoundaries(1, 0, 3, 0) ;
  $buffer->InsertConstruct($text_to_insert) ;

DESCRIPTION ^

Text::Editor::Vip::Buffer::Plugins::InsertConstruct- Vip::Buffer plugin

FUNCTIONS ^

InsertAlignedWithTab

InsertAligned takes a string as argument

InsertConstruct

Inserts a construct at the cursor position or around the selection if any if a selection is present the construct is aligned on the block and the selection is indented.

  $if_construct= <<EOT ;
  if()
  \t{
  \t}
  else
  \t{
  \tSELECTION
  \t}
  EOT

  $buffer->Insert(<<EOT) ;
  line 1 - 1
  line 2 - 2 2
  line 3 - 3 3 3
  EOT
  
  $buffer->SetModificationPosition(3, 4) ;
  $buffer->SetSelectionBoundaries(1, 0, 2, 0) ; # select the second line
  $buffer->InsertConstruct($if_construct) ;

Buffer content is now

  line 1 - 1
  if()
  \t{
  \t}
  else
  \t{
  \tline 2 - 2 2 # this line was moved in the construct and aligned
  \t}
  line 3 - 3 3 3

AUTHOR ^

        Khemir Nadim ibn Hamouda
        CPAN ID: NKH
        mailto:nadim@khemir.net
        http:// no web site

COPYRIGHT ^

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.

syntax highlighting: