logo
down
shadow

Vim mixes up indent style when editing different files


Vim mixes up indent style when editing different files

By : NewGeek
Date : November 22 2020, 01:01 AM
it helps some times You should use setlocal instead of set to prevent your settings from leaking to other buffers.
code :


Share : facebook icon twitter icon
How to indent custom uilabel in a UITableViewCell when editing

How to indent custom uilabel in a UITableViewCell when editing


By : user3430231
Date : March 29 2020, 07:55 AM
it helps some times You'll need to subclass UITableViewCell and override -layoutSubviews. When the cell's editing bit is set to YES, -layoutSubviews will automatically be invoked. Any changes made within -layoutSubviews are automatically animated.
Consider this example
code :
- (void)layoutSubviews
{
    [super layoutSubviews];
    CGFloat xPosition = 20.0f; // Default text position

    if (self.editing)
        xPosition = 40.0f;

    CGRect textLabelFrame = self.textLabel.frame;
    textLabelFrame.origin.x = xPosition;
    self.textLabel.frame = textLabelFrame;
}
Indent UITableViewCell while editing

Indent UITableViewCell while editing


By : Aelagon
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further Solved animating all components (changing frame.origin.x) in this way:
code :
- (BOOL) tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath {

  [UIView beginAnimations:nil context:NULL];
  [UIView setAnimationDuration:.3];

  [cell.CellTitle setFrame:cgrectMake(x+20, y, w, h)];  // +x
  [...]
  [cell.CellAddress setFrame:f2];

  [UIView commitAnimations];

  return YES; 
}
Custom UITableViewCell is not showing indent while editing

Custom UITableViewCell is not showing indent while editing


By : Jason
Date : March 29 2020, 07:55 AM
Hope this helps I'm on iOS 7, have an UITableViewController, with a UITableView (linked up the data source and delegate) and trying to use editing. I use a custom UITableViewCell, with Dynamice Prototype in UIStoryboard. When I click on the edit button (self.editButtonItem), you see the name change to done, but the are no indent icons (- icon). Swiping from the cell works, I get a delete button.
code :
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{


    if (editingStyle == UITableViewCellEditingStyleDelete)
    {
        [arr removeObjectAtIndex:indexPath.row];
        [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationBottom];
    }
}



- (IBAction)editbtn:(id)sender {

    if (self.tableView.editing) {
        self.tableView.editing = NO;
        [edit setTitle:@"Edit" forState:UIControlStateNormal];
    }
    else{
        self.tableView.editing = YES;
        [edit setTitle:@"Done" forState:UIControlStateNormal];
    }
}
Auto indent Javascript code in Emacs (bsd style aka Allman style)

Auto indent Javascript code in Emacs (bsd style aka Allman style)


By : Zarobiek
Date : March 29 2020, 07:55 AM
To fix this issue I couldn't find any built-in functions or ready-made solution, so I read emacs documentation and wrote my own emacs-lisp function. Maybe someone will need it.
code :
(global-set-key (kbd "RET") 'newline-and-indent)

(add-hook 'js-mode-hook
    (lambda()
        (local-set-key (kbd "{")
            (lambda() (interactive)
                (my-bsd-lparen-align)
                (insert "{")
            )
        )
        (local-set-key (kbd "}")
            (lambda() (interactive)
                (insert "}")
                (indent-according-to-mode)
                ;(c-indent-command)                                             
            )
        )
    )
)


(defun my-bsd-lparen-align()
    (skip-chars-forward " \t")
    (setq cur_pos (point))
    (my-line-begin)
    (setq new_pos (point))
    (goto-char cur_pos)
    (if (eq cur_pos new_pos)
        (__my-bsd-lparen-put)
    )
)

(defun my-line-begin()
    (beginning-of-line)
    (skip-chars-forward " \t")
    (current-column)
)

(defun __my-bsd-lparen-put()
    (setq init_pos (point))
    (setq cur_start (my-line-begin))
    (forward-line -1)
    (setq block_start (my-line-begin))
    (setq diff (- cur_start block_start))
    (goto-char init_pos)
    (if (>= diff 0)
        (delete-backward-char diff)
        (loop for i from 1 to (- diff) do (insert " "))
    )
)
How to configure gulp watchers for browser-sync to inject css when editing sass files AND when editing pure css files?

How to configure gulp watchers for browser-sync to inject css when editing sass files AND when editing pure css files?


By : Daidi Hecht
Date : March 29 2020, 07:55 AM
wish help you to fix your issue Since your SASS always compiles to .css you just need to watch for changes in your .css files. It will fire on SASS change anyway (because .css will be generated and gulp.watch triggered by this .css change). Otherwise you can use exclusions in gulp.watch() and use some kind of pattern (ex. subdirectory) to identify .css files generated from SASS. You can try this one:
shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org